Scores of primary children have come together in a music project celebrating their town’s place in railway history.