
A St John spokesman said the car veered off State Highway 88, between Dunedin and Port Chalmers, just before 3pm.
The car left the highway near the St Leonards creek and travelled down the bank before toppling over, coming to rest on its side between the bank and the railway line, he said.
St John staff assessed the driver, who was uninjured, at the scene.
A man who identified himself as the the driver told the Otago Daily Times he did not want to comment due to shock.
A police spokeswoman said the man was 19 years old and an investigation was continuing.
A KiwiRail spokesman said a freight train travelling from Christchurch to Dunedin was delayed for 35 minutes by the crash.
The track reopened at 3.48pm after the line was inspected, he said.
A Dunedin Railways spokeswoman said no train services were affected by the crash.