Rail companies will have to tell passengers in the future there are cheaper fares available when they book tickets to travel after a deal was struck by the government and operators.

A new industry-wide code is being drawn up by a group representing infrastructure operator Network Rail and companies including ScotRail.

It will include a promise to let passengers know whether they are overpaying for tickets, particularly when purchasing from automatic ticket machines in stations.

These can sometimes sell tickets for much more than the same journey might cost bought from a ticket office. Investigations have found some ticket machines charging fares as much as £100 higher than the same journey would cost booked from a sales outlet nearby.

From March, machines must be labelled clearly to inform travellers that cheaper fares for some journeys may be available, and direct them to a ticket office, while eventually they will have to provide this information on screen.

The change is the outcome of a summit meeting held by the government to address the issue of confusing and poor quality information on ticketing being provided by rail operators.

A spokesman for the Rail Delivery Group, which is overseeing the code of practice, said: "The rail industry's commitment to making it even easier for passengers to get good value rail tickets, including when buying from ticket machines, has helped journey numbers almost double in the last 20 years. While the vast majority of people using ticket machines get the right ticket for their journey, we are working hard to make them even simpler and easier to use."

The development comes as commuters across the UK face fresh fare rises. While off peak fares within Scotland are frozen, peat time fares will rise by the rate of inflation.

Meanwhile elsewhere in the UK and for cross border travel, regulated fares will rise by up to 2.5per cent, meaning some have risen well over 20per cent in the last five years.

The January 2015 increase follows weeks of disruption to rush-hour services with problems for passengers compounded by over-running festive engineering work in London and the South East.

The rail industry has said that the increase is the lowest annual rise for five years. But campaign groups and trade unions have pointed out that the annual rises in fares have far outstripped the rises in wages and that Britons pay some of the highest rail fares in Europe.

Trade unions handed commuters special tickets yesterday showing how rail fares have risen.

According to TUC figures, UK commuters spend more than twice as much of their salary on rail fares than some European passengers. TUC general secretary Frances O'Grady said: "This year's fare hike will hit passengers particularly hard because wages are rising so slowly.

"Rail fares are now consuming a huge proportion of people's wages, leaving precious little for other bread and butter expenses."

RMT general secretary Mick Cash said: "The scandal of Britain's great rail fares rip off continues with today's hike far outstripping average pay increases, and it will once again hit those at the sharp end of the austerity clampdown the hardest."

Transport Secretary Patrick McLoughlin said: "We are investing in the biggest rail modernisation since the Victorian era and fares have a crucial role to play in funding these improvements. This is because building better infrastructure helps create jobs, building a stronger economy for us all.

"We recognise passengers' concerns about the cost of rail fares. This is why we have frozen them for the second year in a row. We are protecting passengers even further by stopping operating companies from increasing individual fares by up to 2per cent more."

Shadow transport secretary Michael Dugher said: "David Cameron is presiding over a rip-off railway in Britain. He has failed to stand up for working people struggling with the cost-of-living crisis and has allowed the train companies to hit passengers with massive fare rises of over 20per cent since 2010.

A ScotRail spokesman said: "Fares for four in 10 journeys will be frozen in Scotland."

He added: "There will be no rise for off peak fares and peak time increases will be limited to inflation only. This means that, overall, our fare increases will be below inflation - an average of 1.52per cent."