I wonder that in certain parts of the world, the train network could become net positive electrical contributor by mining stones in quarries up the mountain?
Depends on what you measure, I guess? Ie I don't think you have enough excess energy to pay for the actual quarrying itself. (Though you might be able to become energy positive if you take water as a ballast, not stone. Water is easier to pump into some tanks.)
Well inner mine transport can be net positive as well with electrical mining trucks. Then you need the energy for explosives and stone cutting, which needs further investigation, whether this can be offset by the energy gained of the stones travelling downhill. Water should be better used for hydroelectrical production.
https://www.youtube.com/watch?v=VVaWmEI9O1w