Did 200 km around the hills in the rain yesterday by motorcycle and couldn't be bothered taking my camera out of the bag so you get a pic from today's 40km cycle ride around the city instead.
Yes, it has. https://en.wikipedia.org/wiki/Mount_Washington_Cog_Railway
It's not a rack+pinion like in the Euro alps, but a cog+"ladder" type.
The old steam loco is also "tilted" with a high cabin at the back and a low boiler in the front to compensate for the slope.
Similar to the Fell Train system they used to use on the Rimutaka railway near Wellington. That track had a third centre rail that was raised up and two wheels gripped it horizontally under the engine.