Stuttgart

The city has the only urban rack railway in Germany.

An excerpt from the article 20 facts about Stuttgart

This is a peculiarity of Stuttgart. The rack and pinion railway is powered by electricity and runs between Marienplatz in the southern district of the city center and the Degerloch district. Stuttgart also has a funicular that operates in the Heslach area and a miniature railway powered by diesel (and on weekends, steam) in Killesberg Park, a hill overlooking the city.