Ministers today accused the Treasury of putting the development of Scotland's booming railways at risk by shortchanging them £800 million for future projects.
The Scottish Government said it had been offered £3.4 billion for improvements over the five years from 2019, but needs £4.2bn, based on current spending levels.
Transport minister Humza Yousaf said it would have a "massive impact".
However, he has not said which projects could be at risk by the possible 20 per cent spending cut.
Plans include new stations at East Linton and Reston on the east coast main line south of Edinburgh and re-opening the Levenmouth line in Fife.
Other work includes cutting delays on the Borders Railway by upgrading a junction at Portobello and double tracking a section at nearby Millerhill in Edinburgh.
Improvements are also proposed for Glasgow Central, Scotland's busiest station, and further upgrades to the Inverness to Aberdeen and Perth lines for faster and more frequent trains.
ScotRail's passenger total has increased by one third to 95m a year over the last decade, which is forecast by the train operator to rise to 129m by 2025.
The row has been triggered by a change in the funding formula because track owner Network Rail has switched from being a separate organisation to a UK Government body.
The Scottish Government also claimed the Treasury offer was based on the Barnett Formula, where Scotland gets a percentage of spending south of the Border, rather than a higher rate agreed when Network Rail spending was devolved in 2006.
The Scottish Government's Transport Scotland agency said the change, which will see traditional borrowing replaced by grant payments, "could see as much as an £800m gap in the funding that the Scottish Government projects that it will need to meet future increases in demands for rail services in Scotland".
Mr Yousaf said: "We want to continue to invest in improving our rail network and services to meet future demands, but the changes to be introduced by the UK Government are putting at risk our ability to do so in full."
The minister later tweeted: "UK Govt £800m short when it comes to funding Scottish railways for the next control period (2019-24). Massive impact.
"We'll have to do detailed analysis but hoping UK Govt sees sense."
A Treasury spokeswoman said: "We are discussing the appropriate level of funding with the Scottish Government, who will set this out shortly through the Statement of Available Funds for the railway in Scotland (Sofa)."
She said funding levels were decided by the UK Government in consultation with the Office of Rail and Road, the independent regulator.
The row comes as the latest clash between Scotland and London over rail spending, with ministers repeatedly calling for more control over Network Rail north of the Border.