Most trains find it difficult to climb hills and mountain slopes. The trains of cog, or rack, railroads, however, can scale steep slopes using a special toothed rail, known as a rack, in the middle of the track. The train has a cog that meshes with the toothed rail.