The Rail, Maritime and Transport union (RMT) said discussions with Network Rail, train operators and London Underground had failed.
The strike will cause disruption across England, Scotland and Wales.
The Department for Transport said it was disappointing and that strikes should “always be the last resort”.
The action, which will involve thousands of workers, will take place across 13 train operators and Network Rail on Tuesday, Thursday and next Saturday, and there will be a London Underground strike on Tuesday.
Operators have said there will be knock-on effects on other days as well.
Network Rail, which owns and maintains the country’s railways, said the union was “dismissing talks before we’ve even finished” with more discussions planned for Sunday.
A Network Rail spokesperson said it was “serious” about trying to find a solution and a compromise which gave people a “decent pay rise”, but was also affordable for taxpayers and farepayers.
In a recent Q and A for members, the RMT said its position in all pay negotiations was for an above Retail Price Index (RPI) inflation pay rise.
RPI, a measure of inflation used to calculate the cost of living, was 11.1% as of April 2022 – up from 2.9% a year earlier. The union said it had recently secured an 8.4% rise workers on the London Underground.
As to whether pay rises should be backdated to compensate for pay freezes, the union said any rise “should reflect that members have not had a pay rise… and the drastic increase in the cost of living”.
RMT general secretary Mick Lynch said that “despite the best efforts of our negotiators” no viable settlements to the disputes had been created.
Mr Lynch blamed the government for cutting funding to the transport system – which he said amounted to £4bn – and said as a result companies were cutting benefits, making staff work longer, and making them poorer in retirement.
He said thousands of jobs were being cut across the rail networks and workers were facing below-inflation pay rises.
The RMT says there are proposals to cut 2,500 maintenance jobs on Network Rail, which the union claims could “increase the possibility of trains flying off the tracks”.
Network Rail says it would never consider changes that make the railway or its people less safe