Photo: Norfolk Southern
Norfolk Southern's NS 999 electric locomotive runs entirely on 1,080 12-volt batteries and produces 1,500 horsepower. From the company's press release:
NS 999 is an entirely electric locomotive that uses a lead-acid energy storage system comprised of 1,080 12-volt batteries to operate in railroad switching applications without the use of a diesel engine and with zero exhaust emissions. The plug-in locomotive also can regenerate dynamic braking energy through a system provided by Brookville Equipment Company. The recovered dynamic braking energy continually replenishes the energy storage system, and uses this recovered energy for tractive effort in rail operations. The batteries are carefully monitored and controlled through an elaborate battery management system to assure safety and maximum battery life, and when fully charged NS 999 is able to operate three shifts before recharging is required.
Link via Popular Science
You've pretty much hit the nail on the head there. When the overhead cables or third rail are out, you may need batteries. The battery powered electric loco was first used AFAIK on electric railways such as the London underground when the power to the third rail was off. When the power is out parts and machinery may need to be moved to repair the fault, so a loco is required that needs no external power source and you don't want steam or diesel power in an underground railway. I'm sure such locos have been used on underground railways in the US as well.
On surface railways there seems to be very little point.
I bet it takes a long time to recharge too.
Whenever I despair about the state of the railways in the UK I look at the USA and go "yeah, it could actually be worse...".