The heritage line, which carries more than 350,000 passengers between Whitby and Pickering each year, will also get new facilities and accommodation for staff, and a new vehicle access bridge over Pickering Beck.
The project is seen as the biggest-ever single investment in Ryedale’s tourist industry.
Half the finance is coming from the Heritage Lottery Fund, with the rest raised through legacies and a public campaign.
Planning approval was granted despite concerns from some local residents that the development could lead to flooding.
Ryedale’s senior planning officer, Gary Housden, said the scheme would create up to 50 jobs and contribute £2.55m to the town’s economy.
It has also been given the backing of the regional Local Enterprise Partnership because of the “significant” economic benefits it would produce.
Coun Fiona Farnell, chairman of Ryedale’s planning committee, said: “The development will be a big boost to the economy, especially the tourist industry.
“The Moors Railway has been a wonderful asset to Pickering, and the communities on the route to Whitby. There is enormous interest in heritage railways, and ours on the North Yorkshire Moors is the biggest privately owned.”
The original Whitby to Pickering railway, which takes in the villages of Goathland and Grosmont, was opened 180 years ago, but was a victim of Dr Richard Beeching’s axe in 1965. It reopened as a steam-driven heritage line in 1973.
Julian Rudd, economy lead at Ryedale Council, said the development was “essential” to sustain the one of the area’s key attractions and would encourage tourists to stay longer in the area.