Here are some of the best travel blog references from medium describing one to reach nainital from their location from various transport options easily nd safely:
https://medium.com/@travelindia/how-to-reach-nainital-from-allahabad-by-train-91a06d33c703
https://medium.com/@travelindia/how-to-reach-nainital-to-jim-corbett-a-complete-guide-935b16e0648a
These are the best references one should get on the way so far.