Evacuated passengers were seen standing on the roadside with luggage.
The collision occurred near Kroonstad city in Free State province, after the truck failed to stop at a crossing, a passenger told local media.
The driver of the truck tried to flee, but was arrested by police, the passenger Seipati Moletsane told the privately owned eCNA news site.
"I was so traumatised. I was looking for a door just to jump out but every door was locked... All of a sudden, we saw smoke, smoke, smoke," Ms Moletsane added.
Firemen and ambulances are at the scene, trying to extinguish the blaze.
Private emergency services company Netcare11 said that four people had died and 40 others were wounded in the crash.
The train was travelling from the coastal city of Port Elizabeth to the commercial capital, Johannesburg, when the crash occurred.
More about: #Train-crash