A total of 26 projects designed to improve passenger safety and experience on the railways have secured £5 million in government funding.