A cog railway or rack and pinion railway is a mountain railway with a special centre rack rail[?] mounted in the middle of the sleepers[?] between the regular rails. The trains are fitted with one or more cog wheels that mesh into this rack rail (picture (http://www.pilatus.ch/images/zahnradbahn-stangen.jpg)). This then allows the locomotives to haul the train up steeply inclined slopes.
Examples:
Schneebergbahn
Mount Washington in New Hampshire, built in 1869, the only railway in the world built entirely on a trestle (3.1 miles or 5.2 km long).
... the census of 2000, there are 11,767 people, 3,808 households, and 2,974 families residing in the town. The population density is 2,391.2/km² (6,199.1/mi²). ...