Workers have voted overwhelmingly to accept pay offers from train companies and Network Rail.
Members of the Rail, Maritime and Transport union (RMT) backed a one-year rise of 4.5% at Network Rail (NR) and increases at train operators of 4.75% for the last year and 4.5% for 2024/25.
Almost 99% of train company members voted in favour while NR workers backed their pay rise by 88%.
The RMT said the ballot results mean that the long-running national rail dispute is now over.
A statement said: “This outcome reflects the collective efforts of our membership in defending their jobs, working conditions, pay, and pensions from the attacks of the previous Tory government and their private contractors.
“We thank our members for their efforts during this long but successful campaign.
“Their resolve has been essential in navigating the challenges posed during negotiations and in particular the previous Tory government’s refusal to negotiate in good faith, alongside relentless attacks by sections of the media and the employers.
“RMT remains focused and committed to supporting public ownership as a path to building a stronger future for the rail industry for both workers and passengers.”
Transport Secretary Louise Haigh said: “This is a necessary step towards fixing our railways and getting the country moving.
“It will ensure a more reliable service by helping to protect passengers from national strikes, and crucially, it clears the way for vital reform and modernising working practices to ensure a better performing railway for everyone.
“We have inherited a £22 billion blackhole in the nation’s finances. Every decision taken is to stabilise the economy and protect working people.
“This Labour Government won’t make the same mistake as the Conservatives who deliberately prolonged rail strikes and cost the economy more than £1 billion. We’ll always put passengers and taxpayers first.”