In Washington, by Sam Cabral.
A tentative agreement has been reached to avert the first national rail strike in 30 years.
The deal is the result of months of negotiations and 20 hours of overnight talks.
The outcome was hailed as an important win by the president.
Millions of Americans would have been affected and the economy would have taken a huge hit.
Many of the trains that run on the tracks are operated and maintained by freight carriers.
The strike that was due to start after midnight on Friday will not happen after all.
Changes to existing policies on time off and a 24% wage increase are included in the deal.
"This is a victory for tens of thousands of workers and for their dignity," Mr Biden said. This is a great deal for both sides because they earned and deserved these benefits.
He said that an agreement had been reached that would keep the rail system working.
Three years of heated contract negotiations between railroad management and the unions that represent more than 100,000 workers have come to an end.
Until Thursday, two of the largest unions in the country - representing the engineers and conductors who make up two-person train crews - were holding out.
Staffing shortages have led to punishing schedules for staff.
Workers say they are on call all year long, with no paid time off in some cases even if they are ill or have other emergencies.
According to the Bureau of Labour Statistics, more than one million Americans worked on the railroads in the 1950's, but the industry now employs fewer than 150,000 people.
Over the last six years, tens of thousands of jobs have been lost due to cost-cutting.
A strike would cause supply chain chaos and cost the economy $2 billion a day, according to analysts. The passenger rail service was going to cancel all of its long distance services on Thursday.
President Biden spoke to rail unions and companies. Marty Walsh is a former union leader.
The BLET and Smart unions credited the duo and other Democrats for allowing for an agreement to be reached across the bargaining table.
The difference was made by the solidarity shown by our members who keep America's freight trains moving.
Union members will vote on the agreement.
There will be a cooling off period before strike action if the vote fails.