The New York Times has a very interesting article about the National Museum of Afghanistan, which mentions the steam engines (and links to this website; *waves* to the sudden spike in visitors).
While the emphasis is on the ancient, there are more modern artifacts as well — including several rusting steam locomotives in the gardens. “We have them to remind people that at the end of the 19th century, Afghanistan had railroads, while at the end of the 20th, it did not,” Mr. [museum director Omara Khan] Masoudi said.Source: Saving Relics, Afghans Defy the Taliban. Rod Nordlandjan, New York Times, 12 January 2014
While there were almost certainly no operational railways in the closing days of the 20th century, were there any at the end of the 19th century? It is possible there was something in a factory in Kabul, but I’m not sure whether there were any others. The steam locomotives in the National Museum of Afghanistan date from the 1920s.