The Indian Railways are often the butt of jokes when a number of accidents happen in succession. But it is cold comfort to know that railway operating procedures in developed countries are far from perfect. As in the case of the derailment followed by fire at Lac-Megantic in Quebec province on July 6, 2013.
Here is a Powerpoint presentation on this accident, which was used in a conference of safety engineering at IIT Gandhinagar in January 2017.
the-fire-disaster-at-lac-megantic-quebec
Note the videos on slides 8 and 9. They are important in understanding the sequence of events. The one on slide 8 is more accurate and is largely based on the accident investigation report. The one on slide 9 has a serious error as it shows the train slipping backwards, with the tank cars leading the locomotives. In fact the train went down the incline in its existing configuration of locomotives followed by other cars and tank cars.
You may wonder if something like this could happen on the Indian Railways. Certainly a heavy goods train would not be left totally unattended on an incline in mid-section. That is exactly what happened here.
There are a number of safety-related issues which have not been covered above, such as the hazards caused by additives used to increase the viscosity of crude oil for transportation.
For further reading:
https://en.wikipedia.org/wiki/Lac-M%C3%A9gantic_rail_disaster
http://www.tsb.gc.ca/eng/rapports-reports/rail/2013/r13d0054/r13d0054-r-es.asp