They also use the electric motor(s) for braking, but instead of going into a battery it goes into a bank of resistors.
edit: Thanks for the correction. They do indeed use resistors and just dump the energy as heat. Unfortunate.
Hopefully this will change as supercaps continue to improve. Maxwell tech's modules are already used in light rail, and looks like some work towards smaller locomotives in Switzerland here:
Dynamic brake