Sens. Amy Klobuchar and Al Franken and Reps. Betty McCollum and Keith Ellison announced the grant Friday.
The money will put in place and test a positive train control system, a technology that stops trains automatically to avoid crashes.
The controls are supposed to go on mainline routes that carry hazardous materials or commuters. They use sensors to remotely monitor speed and movement in order to head off train-to-train collisions and derailments.
By federal law, American railroads have until December 2018 to install the safety system on roughly 70,000 miles of track.
Klobuchar, Franken, McCollum and Ellison have been active in rail safety promotion because of the potential risks of derailments or crashes involving trains carrying crude oil from North Dakota across Minnesota.
Some of those shipments go through the heart of the Twin Cities. Oil train traffic has increased markedly in recent years along with the North Dakota oil boom.
"With increased freight train traffic on our rail lines, ensuring the safety of communities along rail routes remains a top priority," Klobuchar said in a statement.
Franken said in a statement that he has talked to "many community leaders who share my concern for the safety of railcars that travel through our Minnesota communities, and I'm glad that the Transportation Department is listening."