One of the reasons this was needed for a long time is that DC traction power systems used rectifiers that only worked one-way, so you couldn't just spit the regenerated braking energy back out on the main AC grid. So without somewhere to store it, regenerative braking would cause temporary overvoltages on your traction power system.
With modern power electronic converters, it's probably cheaper and easier to just use the main AC grid as the sink for the regen braking power.