A July inflation figure on which annual rail fare rises have historically been based was 3.6% this year, the Office for National Statistics announced.