It's about an hours travel from Mumbai CST. Get to the Central line at CST. There are many direct trains from CST to Khopoli via Ambarnath. The frequency is roughly one hour.
If you are coming from Pune side, get to Khopoli. From there catch a suburban train to CST. The route as mentioned above, in reverse order.
For those coming from Nasik side , get to Kalyan to change train for Khopoli. The route is as mentioned above.
From Ambarnath railway station catch an auto rickshaw for the Shiva Temple ( aks for Shivalaya ). It's a 5-10 minutes ride through the uphill roads of Ambarnath town. On return, you may get a share auto provided you've the patience to wait till the rickshaw get its passenger capacity filled.
Ambernath Shiva Temple
Mumbai Suburban Rail Map.