The ghost of Zoltán is rewarded for a good life by being allowed to drive the cog-wheel railway up and down the Buda hills at night.
This had been Zoltán’s life ambition, and he is very happy.
However, the people living near the cog-wheel railway are worried why the railway is running when it should be closed down for the night. So they call the police, who try to set a trap for whoever is driving the railway. But the trap does not work, as the police cannot see the ghost of Zoltán driving the train.
The local dogs and cats, who can see ghosts, welcome Zoltán and the night journeys of the cog-wheel railway.