Nearly all locomotives in the U.S. are propelled by an electric drive that is powered by a diesel generator, the air pollution from which contributes to more than 1,000 premature deaths every year. Dramatic improvements in battery technology plus access to cheap renewable electricity open the possibility of battery-electric rail. Given that locomotives already have an electric drive, converting them to battery-electric primarily requires a battery car, which can be connected directly to the drivetrain. We examine the case for a battery-electric U.S. freight rail sector and find that one heavy-duty battery car can power a typical locomotive for 450 miles, three times the average daily distance travelled by U.S. freight trains. We find that battery-electric trains can achieve cost parity with diesel trains with electricity charging costs under 6 cents/kWh. We illustrate how these costs can be achieved with access to wholesale electricity rates. Converting the fleet to battery-electric would remove 37 million metric tons of carbon dioxide and generate total sector cost savings of $250 billion over 20 years, while introducing 238 GWh of mobile batteries that could address location-specific grid constraints during extreme events.