At its peak more than 40 firefighters tackled the blaze in Albion Terrace, which started at about 08:10 BST.
The line, which was closed for safety reasons, was reopened at about 15:15.
South Yorkshire Fire and Rescue (SYFR) said crews were expected to be at the scene "damping down" throughout the evening.
It is believed the unit was being used to manufacture soft toys from the film Minions.
National Rail said trains are now running normally between Sheffield and Doncaster.
Kevin Ronan, from SYFR, said: "We're on top of the fire now. We're just in the process of damping down the remains of the incident.
"Parts of the building have collapsed already. It's been totally involved and it will probably have to be taken down."
He said the cause of the fire is under investigation.
A fire at an industrial unit in Hexthorpe caused disruption to train services between Sheffield and Doncaster for several hours.