The money will let agencies avoid doomsday scenarios of thousands of layoffs and drastic service cuts.
Amtrak is planning to scale back many of its long-distance routes.