Train operators in rural Canada were trapped by raging wildfires, as nearby communities were evacuated.