The U.S. rail sector is responsible for significant air pollution damages due to its dependence on diesel-based propulsion. One pathway to a zero-emission rail sector involves electrifying railway tracks and using emission-free electricity which requires significant storage combined with renewable electricity on the grid. We consider an alternate pathway, adding battery storage cars to diesel-electric trains. This approach would enable the rail sector to store and run on renewable electricity while obviating the need to electrify tracks. We show that the dramatic declines in the cost of battery storage and renewable energy present an opportunity to eliminate rail emissions cost effectively. We build a bottom-up cost model to explore the technical feasibility and costs of retrofitting diesel-electric trains with large batteries. We show that a single railcar carrying a 9-MWh battery is sufficient to power an average Class I freight train for 150 miles, the average distance traveled in a day. We establish a baseline scenario with high charging costs, no consideration of environmental benefits, and no further decline in battery prices, and we compare it against scenarios with lower charging costs, lower battery prices, and valuation of environmental benefits. Across these scenarios, the 20-year net present value of savings for the U.S. freight rail sector ranges from a cost of $54 billion to savings of $250 billion. In addition, a battery-electric rail sector would provide more than 200 GWh of modular and mobile storage, which could provide grid services and improve the resilience of the power system.