Electric trains and trams in Europe already have regen braking. And no need for batteries!
Quote: When regenerative braking is employed, the current in the electric motors is reversed, slowing down the train. At the same time, the electro motors generate electricity to be returned to the power distribution system
https://www.ctc-n.org/technologies/regenerative-braking-trai...