from a mathematical point of view, to make it 'fair' on larger countries you should square the length of railroad before dividing. Otherwise an identical country 100 times bigger in area will have a ratio that is 10 times smaller
If two countries both had a similar grid of cities 10 km apart, with railways going along the gridlines, then both countries will have 20 km to 40 km of rail per 100 km2 of area. Not that large a difference.
However if you square the length, then a small country, that might have 9 cities, will have a ratio of 36 in comparison to a country with 25 cities' 100. That is a large difference for the same layout.
Another way to think of it is having a country with a rail network like a Nordic Flag. As the country gets extra flags added, on, the rail:area ratio will not change.
Sorry for responding late. I'm with GreenFriday, basic unit for railroad it's kilometer and for surface is square kilometer. A railroad give service not just in it's own long but many kilometers along. Of course, you are right from a mathematical point of view, that's undeniave. But in practise I think the units are right.
Jetpunk data doesn't seem to have Taiwan, which is disappointing. however, according to Wikipedia, Taiwan has 1691 km of rail and an area of 39193 km2, so has a ratio of 46.72 km of rail per 1000 km2, putting it just ahead of Cuba.
It's true Taiwan have not data. I'm not sure about merging sources of info, I'll try to see if I can found all the other countries as it would be unfair take just one of then from Wikipedia.
However if you square the length, then a small country, that might have 9 cities, will have a ratio of 36 in comparison to a country with 25 cities' 100. That is a large difference for the same layout.