The engine left the tracks and apparently hit a freight wagon before running into a building.