Here is the timeline as best as I can figure.
The oil cars originated in North Dakota, at point point moved into Canada and passed through Toronto on its way to Montreal.
At Montreal, the cars were handed over to MMA. The MMA train left Montreal and and stopped for the night in Nantes. All reports are that at Nantes the crew shut down all but 1 of the engines, leaving one engine running to maintain the air brakes. No mention has been made of whether any handbrakes were set, though from the beginning MMA has been insisting that the crew followed all procedures. This occurred at about 11:25pm.
Around 11:30pm the Nantes fire department responds to a report of an engine on fire. They do find the running engine on fire, and as per their procedures they use the external emergency shut off to turn the engine off before putting the fire out. When the fire is out, they leave and inform MMA of what has happened and what they have done.
Some time after the fire department leaves a nearby resident who was outside witnessed a train with no lights go past, and some time later he heard the explosions in Lac Megantic.
At some point after the start of the fire an engine is brought in from the Nantes side to pull some tank cars clear of the fire from the rear of the train. It is unkown if these are the original engines (somehow left behind, seems unlikely), or if this was another engine from another train.