Wait at Panvel Station till 4:30 am, ticket booking counters would open by 3:30am for local train tickets at Panvel take a local train ticket till Thane, at 4:35 am slow local there from Panvel to Thane..
Else take a Mail train ticket till Thane and see if you can get 12134 mumbai express or 10112 konkan kanya express till Thane, Mail ticket counter will be open anytime at night..