Rail commuters will see more police on duty after vandals with catapults smashed train windows as they passed through a city.