There is a difference between players having agency even as prisoners and railroading them into a successful escape (+ recovering their gear) or overthrowing the captors.
Sadly player expect that to happen which in turn influences their actions.
You must be talking about your players. You're not talking about mine.
As far as railroading is concerned, you are the one who seems to be advocating it - ie advocating railroading capture PCs into a TPK.
The limit is that it creates the expectation that imprisonment is just a small detour for the ongoing adventure and that after a few sessions they are back on track
All this only makes sense if you assume the game is a railroad - with "detours" and "tracks" and "ongoing adventures".
If the PCs surrender, that
is "the adventure". If they then try to escape, well
that is now the adventure. My view is it can make for fun and interesting play, which is basically what I am looking for in RPGing.
Why were the PCs beaten in a traveller setting? Why was the guard who "interrogated" them armed with an SMG, the room unlocked and unguarded, the battle dress not stored securely in the armory? All this makes no sense and is just there to railroad the PCs to escape.
I linked to the session report.
Here it is again.
But in summary: The PCs were not interrogated by a guard; they were interrogated by an interrogator. When not being interrogated they were in a compound with a guard. He was armed with a SMG because that is a standard weapon in Classic Traveller. As is explained in that post, the escape attempt was the result of the player of one of the captured PCs, and the last to remain conscious, asking himself
should i go kinetic? and deciding to do so; there was no railroading.
Why was the battle dress not store securely in the armoury? What armoury? Who said anything about an armoury? It had been taken off so its wearer could have a shower. It had not been locked away. That would not be the first time someone didn't lock away a precious thing. As the play report describes, when the PC went to get the battle dress I called for a 2D check: 10+ and it all goes perfectly, 7+ and it's not too bad for the PC. The roll was in the middle range; had it been below 7 then I don't know what I would have narrated, but maybe the battle dress being locked away, or malfunctioning, or just taking a really long time to put on, would have been possibilities.
To be honest, you seem to have a really limited range of ideas about how a RPG can be GMed and played. Predetermined outcomes seem to be a big part of your conception. That's not my own approach - and, of relevance to this thread, my approach seems to successfully address the issues raised in the OP.