Two freight cars carrying spray cans and other hygiene products caught fire late Wednesday as a train was traveling through Rhineland-Palatinate, state police said in a statement.
The blaze caused spray cans aboard the train to explode and fly through the air, a police spokesman said. The flames caused damaged to the two freight cars, an overhead line and a barrier designed to limit noise from the railway, though no residential buildings were affected.
Preliminary investigations by police suggested that the fire was possibly caused by brakes overheating.
The engineer on the train, which was heading towards the former West German capital of Bonn, did not notice the fire at first, authorities said. The driver of another oncoming locomotive noticed the flames and contacted the Deutsche Bahn's emergency control center.
The train eventually stopped at a station in Unkel, a small town located along the Rhine river in northern Rhineland-Palatinate. The station was immediately closed off, and traffic on one of the two train lines was also halted.
Firefighters from the nearby city of Neuwied put out the flames. Authorities also evacuated nearby homes, moving 58 people to safety. The fire was brought under control early on Thursday morning, police said.