Traveling from Delhi to Mysore is a two days two nights affair by train; of course you can travel from Delhi to Mysore by flight (via Bangalore or Chennai), even that probably takes a day due to the transit though flight time is much shorter.
There is one direct train from Delhi to Mysore, and many options if you are planning a break journey. A sleeper class ticket from Delhi to Mysore cost you about Rs600 (approx $13) in an express train.
Swarna Jayanthi Express ( Train No 12782) is a weekly train that leaves from H Nizamuddin station of Delhi every Monday and arrives at Mysore Junction (see Mysore Railway Station ) on Wednesday covering a cross country distance of about 2600km (1615 miles) between Delhi and Mysore. In the reverse direction Swarna Jayanthi Express ( Train No: 12781) leaves Mysore Junction on the Fridays and reaches H Nizamuddin on Sundays.
Bangalore city, located some 140km (3 hours) northeast of Mysore city, is well connected with Delhi with frequent rail connections. From Bangalore to Mysore you can travel by train or bus services, which are quite frequent. Get down at Bangalore City Junction railway station. You can get trains to Mysore from this station. Or you can walk down to the KSRTC bus terminal that is located just across the railway station, for bus connection to Mysore. Hiring a cab from Bangalore is another option.
Delhi to Bangalore takes anything from 33 hours to 46 hours depending on the train. There are about 3 daily trains in each direction between Bangalore and Delhi.
Karnataka Express (Train No 12628) is a daily train between Delhi and Bangalore.
The Yesvantpur Sampark Kranti Express (Train No: 12630) operates from H Nizamuddin Wednesdays and Fridays to Yesvantpur Junction. The return train ( Train No:12629) operates on Tuesdays and Thursdays. In that was this pair compliments the pair 12650/12649.
The Coimbatore bound Kongu Express (Train No:12648) from H Nizamuddin travels via Bangalore. This is a weekly train (Wednesdays). In the reverse direction (Train No:12647) Kongu Express leaves Bangalore City Junction on Sundays.
Apart from these, there are many train options depending on where you break the journey and the route you plan for a connection train. For example there are direct trains from Mumbai to Mysore and also to Bangalore.
As there could be changes, please check the details with the Indian Railways website for the current and accurate train details.
Mysore to Ooty via Gudallur distance is about 183km : Mysore City — 24km –> Nanjangud — 43km –> Gundlupet –20km –> Bandipur National Park — 5km –> Karnataka Tamilnadu border — 7km –> Theppakkadu — 17km –> Gudallur Town — 46km –> Pykara Lake — 21km –> Ooty