I think for common people , they need to get a written permission and a visitor pass from the SM or from concerned Loco shed Mechanical engineer In charge.
I don't know the proper procedure.
But if you wish to have a "Unofficial" ride, then you can have at these two places (as far i know):
1. Braganza Ghats. From Castle rock , many...
more... light Brakers WDG EMD go towards Kulem. If you raise a hand and ask the pilot for a lift, majority give a ride till Kulem. Or sometimes even from Dudhsagar falls also you can get a lift if there's no trains coming.
2. Same is possible between Khandala and Karjat Bhor Ghat.