Sir Keir Starmer said the funding covers a list of Welsh railway projects, including seven new stations.