The passenger train crashed into a lorry and another vehicle near Kroonstad in the country's Free State at about 9.15am local time (11.15am GMT) on Thursday.
Tebogo Magoro, spokesman for Netcare911, said: "40 passengers are reported to be injured with four fatalities confirmed at this stage."
At least 100 people were injured, Russel Meirin, spokesman for emergency medical care organisation ER24 said.
"Provincial fire and medical services were the first to arrive on the scene, finding that several carriages were lying on the side.
"A fire had broken out in one of the carriages and had begun to spread," he added.
More follows...