For the U.S., try http://www.fedstats.gov/agencies/
Select the Bureau of Transportation Statistics, the Surface Transportation Board, or the Federal Railroad Administration for stats on freight railroads. For rail transit, try the "National Transit Database" (you can find it through the link above).
For Canada, do a search on Transport Canada.
For Europe, try the Union Internationale des Chemins de Fer (International Union of Railways). They may publish some sort of combined stats for European railways, at least. For the rest, you'll probably have to do a country-by-country search.
I'm sure the data is available, it will just take some digging. Good luck.