How did the first railways work?

With oil

With gas

With electricity

With coal