Answered by ZUPAN | Jan. 01, 2020 14:56
Yes, this is possible and you are allowed under 144 hour visa free transit to use a train that departs from Shanghai railway station for Hung Hom railway station. This is a conventional train departing every other day from Shanghai at 17:45 (5:45pm) and arriving in Hong Kong the next day at 13:01 (1:01pm). Very important detail is in the fact that you can leave Shanghai on your last available day without taking care about the fact that it will not physically exit mainland China during that day. This is because of the fact that the time taken into consideration is the one of your boarding. At that very moment it is considered that you have left China.
Also, you have to take care to book a ticket for this train in advance. You can book it even through this agency (Travel China Guide). You will provide an address of your accommodation in Shanghai and the real, paper ticket will be delivered at that address. In the meantime, after your booking, you will receive an e-confirmation that you will print out and take that printout with you as a proof of your transit. This is not so complicated, although it does require some planning in advance.