With track maintenance work scheduled on the main line linking Dundee, Perth and Glasgow earmarked for Saturday, May 17, the clubs supporters feared they would face a problematic journey to attend the match at Celtic Park.
But yesterday a ScotRail spokesman offered hope to anxious fans. He said: "We recognise the achievements of both clubs in reaching the cup-final and that fans will want to travel to Glasgow to cheer on their teams.
"We've been in touch with the clubs and are discussing with Network Rail how best to arrange special trains from Perth and Dundee for supporters to get to and from Celtic Park on May 17. Details will be confirmed in the next few days."
A St Johnstone spokesman said: "This is great news for fans, because I'm sure many will want to make the trip to our first-ever Scottish Cup final by rail. The more options available to them the better."
The rail works, including a major bridge replacement at Larbert, were planned nearly two years ago and Network Rail have said it cannot be postponed. A spokesman said: "These works have been planned for more than 18 months and are part of a wider investment in the long-term future of Scotland's railway. Rearranging the works - and the specialist engineers and equipment required - at short notice is extremely difficult and could raise costs, have a significant knock-on impact for future projects and extend disruption to the local road network."
The match at Celtic Park against Dundee United will be the first Scottish Cup final in St Johnstone's 130-year history.