Rail passengers will have to pay an average of 3.1% more for train tickets in 2019.