If you don't have a grid as "storage", you need to carry it, and that's a problem. And freight trains obviously only have motors in the locomotive(s) and do the distributed braking on the cars mechanically, so a good chunk is lost even if the locomotive can do it.
For the rest, they don't because of lack of storage.
A diesel locomotive has a huge engine block, a generator, a large radiator, and electric motors on the axles. You can turn the motors into generators when you want braking, but where are you going to put the electricity? All the space (and weight) is already used.
Yes, they have batteries - enough to crank the engine when it has been turned off. Not enough to run the electric motors on the wheels, though.
Bring back the tender[0], but fill it with batteries instead of coal. Or better yet, intermodal container shaped batteries that could be swapped for pure electric long distance trains.