You can take any train to Pune and get off at Lonavala Railway station. From here, you can take a local train toward Pune and get down at Malavli railway station. You can reach the Lohagad Fort by taking a shared auto around 5km from the station. https://goo.gl/maps/dvywTs2mRQm2poRj8