You can ask TTE (concerned TTE near your destination, as in such long distance, four-five intermediate charting stations are there) for extension of ticket, by paying the balance amount. Since, Trichy & Madurai are nearby, so you should easily get vacant seat to the balance journey or continue on the same seat.