The freight train, which was carrying materials for cement, came off its tracks in the small town, prompting a major clean-up and traffic chaos.