My train ticket is from Gwalior to Yesvantpur but can I get off at the next station, Banasawadi?
Not without getting a ticket to cover your journey.
In food terms, it'd be like paying for 6 meals and just taking the 7th. It's not allowed. Similarly, if your ticket is valid from A to B, continuing on to C is NOT on the ticket's terms.
You might get away with it if you stayed on, and played dumb ("oh I fell asleep and missed my stop") but if there's checks or gates, you're going to get caught.