The pricing deal emerged after the announcement that commuters will be hit by a 3.9% rise in peak fares from the new year. ScotRail declined to reveal the exact cost of the lower fare increases but said it would be offset as more passengers were persuaded to switch from road to rail.
Transport Minister Keith Brown said it would not lead to further taxpayer subsidies to ScotRail, with the off-peak fare freeze only to apply if inflation remains below 3.5%.
Mr Brown also confirmed FirstGroup would be given a five-month extension to its 10-year contract to run the franchise, which had been due to expire in November 2014.
The extension, until March 2015, will allow for lessons to be learned from the West Coast rail debacle, which was the subject of a damning report by Centrica boss Sam Laidlaw.
A competition to win the 10-year Scots franchise, with a five-year break clause, will be launched next summer, shortly after a separate competition for a 15-year franchise to operate the Caledonian Sleeper.
Rail fares across the UK have increased at 1% above inflation, measured by the Retail Price Index (RPI), since 2004. The Coalition has made two attempts to introduce higher fare increases but have rowed back each time in the face of protests by passenger groups.
Mr Brown said the fares cap had been agreed following successful negotiations with First ScotRail. "I can confirm that peak fares will be capped in January 2014 and 2015 to RPI, delivering benefits two years earlier at no additional cost to the
franchise subsidy," the minister told MSPs. "I want attractive fares that will encourage commuters to switch to off-peak services and better spread the demands on our rail services. And I want greater use of the train rather than the car for leisure travel."
Service improvements to Ayr, Oban and Aberdeen will be introduced in 2014, within the existing ScotRail franchise, as a result of its extension, while electrifying the Stirling/Alloa/Dunblane route will take place between 2014 and 2019.