You can board a train from Amritsar to either Moradabad or Rampur and then carry the onwards journey via road and nainital being a hilly terrain doesn't have a railway station of it's own. Moradabad to Nainital is approx 3.5 hours journey, whereas rampur to Nainital is approx 3 hours.
Right now there is no direct running train to Kathgogam (nearest railway station to Nainital) you can travel to New Delhi from Amritsar via train and than board a next train to Kathgodam from New Delhi.
Nainital is very well connected by road, driving to Nainital takes 6 to 7 hours. From Delhi, it's 290 km almost, highway driving throughout. NH 24 connects Delhi to Rampur via Hapur. The nearest railway station is Kathgodam, 35 km away. Taxis charge Rs 400-500 to Nainital, you can also board taxis on sharing basis which would cost 70 per person.
The nearest broad gauge railway station from Ghorakhal is Kathgodam which is at a distance of 35 Kilometers. There only three daily running trains from New Delhi to Kathgodam. 1. 12040/New Delhi – Kathgodam Shatabdi Express. Departs at 06:20 am from New Delhi and reaches Kathgodam at 11:40 am. 2. 15035/ Uttarakhand Sampark Kranti Express. Departs at 16:00 pm from Old Delhi and reaches Kathgodam at 22:45 pm. 3. 15013/Ranikhet Express. Departs at 22:05 pm from Old Delhi and reaches Kathgodam at 05:05 am. You can board a train from Amritsar to Moradabad or Rampur and then continue your journey via road to Nainital. Nainital is 115 kms from Moradabad and 100 kms from Rampur