The fire broke out sometime before 5 a.m. in Queens.
Video from the Citizen app showed the flames on the track beneath Hunters Point Avenue.
Some southbound 7 trains were stopped at Woodside-61 St or Queensboro Plaza and turned back for Main St-bound service as FDNY members worked to extinguish the flames.
Service was restored by 6 a.m. Commuters were advised to expect residual delays.
No injuries were reported.