In that case,I would choose nagarcoil to rmm TNSTC ultra deluxe semi sleeper bus,
It will go via virudhnagar manamadurai I think, at least it will be a direct connection.
Also there is a chance of private sleeper overnight buses,so you should enquire about it.
Going to Madurai by train,than catching early morning bus will spoil your night.
In...
more... case you give preference to go via madurai, get out of railway station to get to city bus(78,78A) to mattuthavani bus stand,which runs 24*7.
at bus terminal,rmm bus might depart from platform 2-3 not sure,but you can see on chart or get help from help desk.
Bus fare will be about 70-80 rs from mdu to rmm
Don't take an auto as they'll ask more fare, instead go for FastTrack prepaid taxi or ola.
Distance from madurai to mattuthavani bus terminal is about 10-12 kms