Companies running passenger trains in future will be required to deliver better services, the Scottish government has said.
Transport Minister Keith Brown said a £5bn railway investment would need to be matched by more trains running on time and improved infrastructure.
Mr Brown outlined his vision for rail services , ahead of the current rail contract ending in 2014.
The opposition said the plans were a "climbdown" from previous proposals.
The minister's comments came in the wake of a consultation by government agency Transport Scotland published last November, which suggested reforms including a blanket alcohol ban on trains, cuts to sleeper services and having cross-border trains stop in Edinburgh.
The Scottish government has agreed to commit £50m to secure national sleeper train services, with the UK government putting in the equivalent amount.
And Mr Brown has ruled out plans for cross-border trains heading to and from the north of Scotland to stop at Edinburgh for a change-over, adding that there would be further consultation with transport police on cutting anti-social behaviour, which can be fuelled by alcohol, on services.
FirstGroup currently holds the rail contract - one of the biggest awarded by Scottish ministers.
The government puts more than £700m a year into services, while the money ScotRail makes from passengers pays for about a quarter of the cost of providing its services.
There are about 78 million passenger journeys each year, according to Transport Scotland, while demand for services has increased by more than 25% in the past seven years.
Mr Brown said the £5bn of investment, between 2014-19, would help boost services between Glasgow and Edinburgh and deliver the Borders Railway.
Network Rail, which looks after rail infrastructure, will also be required to take forward several improvement projects, including works on the Highland main line and between Aberdeen and Inverness.
After 2014, the next rail contract will be extended to run for 10 years, with a potential "break point" after five years, while the next franchise to operate the Caledonian sleeper service will run for 15 years.
The transport minister also said rail fares would be "attractive and affordable", while companies bidding to run services would need to link trains with other transport forms, such as busses and ferries, and deliver internet access through wi-fi, across the rail network by 2019.
Ministers will also set targets to ensure more trains run on time.
Mr Brown told parliament: "We have created a comprehensive package of measures which, working with the rail industry, employees and passengers, will deliver high-quality rail infrastructure and services responsive to Scotland's needs, representing good value for money, supporting our businesses and communities, promoting tourism and offering real alternatives to road and air travel.
"Scotland deserves a 21st century railway and this government will see it delivered."
Responding to the minister's statement, Labour's Richard Baker said: "It represents the end of a protracted climbdown after a much-criticised consultation which proposed ending cross-border services, withdrawing sleeper services and closing large numbers of stations.
"These proposals met with opposition, not only in this chamber, but in communities and from trade unions."
The Tories' Alex Johnstone said the statement raised more questions, adding: "I believe a 10-year franchise is the minimum that's required in order to encourage a new franchisee to make the investment necessary to achieve the passenger comfort levels (the minister) mentions.
"But then he appears to make it clear he believes he can break that contract after five years - something which would undermine any attempt to encourage a new franchisee to invest."
Liberal Democrat transport spokesman Jim Hume MSP, said: "I am pleased that the Scottish government has listened to the calls from the rail industry and passengers by going ahead with a longer franchise.
"However I am concerned that the 'independence get-out clause' inserted into the new franchise agreement will fail to bring the stability that passengers need."
Green MSP Patrick Harvie branded the government's rail plans "pathetic" and "steam-age".
Elsewhere, Mr Brown also argued the Scottish government's rail ambitions were being hampered by UK legislation, under which Scotland has been denied powers to change regulation or improve accountability.
He also pledged to continue making the case for extending high-speed rail to Scotland.
This week has seen the launch of a free wi-fi trial on four trains running between Glasgow and Edinburgh, Scotland's busiest train route.