A rack railway is a steep grade railway with a toothed rack rail, usually between the running rails. The trains are fitted with one or more cog wheels or pinions that mesh with this rack rail.