NSW Fire and Rescue crews have described the scene of a train fire between Merrylands and Granville stations in Sydney as a "dangerous and hazardous" rescue operation.

The train driver had to be rescued after the fire broke out in an overhead electric motor this evening.

As the train was on an elevated overpass, about 20m above the roadway, the rescue effort was initially delayed. Aerial crews were brought in to bring the fire under control.

Rescue crews used a cherry picker to reach the trapped driver. (9NEWS)

Crews eventually used an aerial platform - or cherry picker - to access the driver.

The driver was freed and did not suffer any injuries. There were no other passengers in the carriage where the fire broke out.

"Firefighters on the train conducted a full search and confirmed all passengers have been removed," NSW Fire and Rescue Duty Commander Kernin Lambert said.

"We are currently working very closely with rail authorities and electrical authorities to make sure that extinguishment is carried out as safely as possible."

Thirty firefighters worked to bring the train fire under control tonight. (9NEWS)

Emergency services had isolated power on the train line to enable the rescue, however they planned to work throughout the evening to secure the site.

The crews had to isolate power before the fire could be extinguished. (Picture: Fire and Rescue NSW)