China's long history of railways is far too complex to even consider here. Instead I'll offer you here some historic pictures from China's railway infancy.
The Qing emperors failed in the 1800s to develop railway transportation as a means of improving the economy.
It was the foreign colonial powers from the mid 1800s that started to build railways in China. Locomotives would have to be imported as none were made or available within China. As an example, the locomotive bottom left was made in the USA.
Beijing Central Railway Station
Qing officials frowned upon bringing trains into the capital so Beijing's main railway station, Majiapu, was located outside the city.
As part of the 1901 treaty after the Boxer Rebellion, Qing was forced to open up the city for rail transport and construct a railway station at the foot of Zhengyang- men (picture above).
The locomotive immediately left is allegedly the first steam train ever to enter Beijing.