I'd heard this story anecdotally from a railfan friend and it recently surfaced in my social media feeds again. Emergency use of diesel locomotives to provide electrical power after a 1998 ice storm in Boucherville, Quebec:
https://gizmodo.com/that-time-a-cana...-derailed-a-di...