The investment in Welsh rail announced by Chancellor Rachel Reeves in her spending review will be spent on new stations and upgraded lines.