Most of these locomotives use regenerative braking to recharge the batteries. This also acts as dynamic braking, instead of wasting the power through a resistor grid it uses the electricity generated by the traction motors to recharge the batteries. When used in conjunction in a consist with diesel powered locomotives, they are used to generate additional power when needed for instance when pulling a grade and use regenerative braking on the downhill to recharge.
A mining operation in Australia will be using all electrics to move loaded ore cars downhill for processing/shipping and taking empties back up without needing to be recharged. There are wayside charging stations in case they are needed, charging time estimated to be about 1/2 hour. In theory these partially charged locomotives moving downgrade should be near fully charged at the end of trip.
Read here:
https://www.batterytechonline.com/battery-applications/electric-locomotive-supports-sustainable-mining-in-australiaNot all of this technology has a downside. Whether you agree with the technology or not it will happen.
Caveat, I do agree with the issue with mining raw materials used to produce the batteries.