I have been fortunate to have ridden many 10's of thousands of miles (er kms) pulled by steam power back in the 50s, 60s and early 70s. The most miles I have ridden behind steam were pulled by IR Broad Gauge WP Class Pacifics:
The first 16 prototypes of this were built at the Eddystone plant of Baldwin. Later Baldwin supplied another 100 or so. Then they were built in large numbers by CLC and MLW in Canada (hence their colloquial name "Canadian Engine"), and most numerously at Chittaranjan Locomotive Works in India. Some were also manufactured in Poland and Austria. A total of 755 were in service in India at one time. Now there are about half a dozen remaining, with at least three in running order.
And the next most miles ridden was pulled by IR Meter Gauge YP Class Pacifics:
These were deployed not only in India, but also in East Africa and Malay Peninsula.
The third most miles ridden were behind the IR Broad Gauge WG Class Mikados:
These were meant primarily to be used for freight (goods) trains, but in the later years were pulled into pinch hitting for slower passenger trains. They were manufactured in England, Scotland, Germany, Austria, USA, Japan, Switzerland, and of course in India. In all some 2400 were built. The last one was built in 1970 and was named "Antim Sitara" which means "the Last Star". Several are preserved in usable condition.
Here is a picture of preserved "Antim Sitara" (WG 10560) which sits on display at Chittaranjan Loco Park, close to its birthplace: