Trains for Dunhuang leave from Jiayuguan Railway Station which is at the west end of Ying Bin Street.
Bus 12 runs all along Ying Bin Street. Bus 1 runs along the North end of Xin Hua Zhong Lu Street and then turns onto Ying Bin Street. The train station is the last stop for both of them.
There is no fast train to Dunhuang. The fast trains use Jiayuguan nan (south) Railway Station.
In Dunhuang, there are green minibuses, Bus 12, right outside the exit that go the 13 kms to the city. The final stop is right by the little river bridge.
Bus 12 also goes to Mogao Grottoes which is near the train station. From Dunhuang, they go to the Mogao Visitor Center and the train station. Make sure to let the driver know which one you are going to. They leave from the stop right by the river bridge.
The train station bus will also go to the airport on request since it is right past the train station.