Four of Melbourne's historic red rattler train carriages were damaged and two heritage-listed buildings were destroyed in a big coal fire in the early hours of Wednesday.

Firefighters were called to the Newport rail yards in Melbourne's inner-west about 1.30am where flames had engulfed two workshop sheds.

The sheds, which housed historic locomotives for restoration, were built between 1884 and 1888. Both buildings were heritage listed.

It took more than two hours for 80 firefighters to bring the fire under control.

Some of the carriages destroyed in the fire were believed to be up to 100-years-old. Four red rattlers were also damaged.