The MBTA said this diversion will help crews replace tracks and ties as well as improve signals and upgrade stations.