Hi Jessi,
Visas are issued on arrival in Nepal. Although I've been told by MANY Nepali people that monsoon season is definitely
not the optimum time to visit, so if you do go be prepared for long delays and lots of washed out roads.
I would head to the train station in Trivandrum and book a ticket as soon as you can. The primary train to Delhi is the "Kerala Express" and it runs every day. The fare should be about Rs 650 to 700 or so for sleeper class which should be more than sufficient; if you want AC, the 3-tier AC fare is about Rs 1700. This train begins in Trivandrum and terminates at New Delhi station.
There's another train called the "Rajdhani Express" but it terminates at Hazrat Nizamuddin station which I can tell you is farther out of the main part of town. Not like hideously terribly far, but not as convenient as New Delhi Jn.
You could head from Delhi to Haridwar and Rishikesh, and then perhaps on to Dehra Dun and Mussorie. There are plenty of trains that run from Delhi to Haridwar (ask at the train station in Kerala while you're there, they can book it for you!) and you can easily find jeeps to book onward travel when you get there.
Alternatively, you could take a train from Delhi to Chandigarh in Punjab (again, ask at the train station in Trivandrum) and from Chandigarh you can easily find a jeep taxi to Shimla.
Do you have a guidebook to do some research? If not I'd recommend trying to find one at a bookstore in Trivandrum-- I saw Lonely Planet being sold in several places around India. Also check out
India Mike, the major India-based message boards. Not to take anything away from travelpunk of course, but that board is massive and completely dedicated to the subcontinent.
I hope this helps and that you're taking lots and lots of pictures!!!