Varoius advantages:
On a hilly route with lots of stop-start running, a battery can capture well over half of the energy expended by the diesel, so half the fuel costs.
The diesel engine can be much smaller and cheaper, as it only has to generate the average power used over the route, rather than the peak power requirement.
Steady running incurs much less wear on a diesel engine than the intermittent loads of purely diesel traction.
And if the batteries have enough charge to get back to the wires, you don't need to run the engine at all.