Don’t.
Figure out some other way of advancing the scenario, or at least what path it will take if the players succeed instead of failing.
If you absolutely feel that you have to, then:
For my money, the best way of handling this is openly telling the players that the outcome of the scene is required by the plot. If you’re going to railroad the players then telling them about it will usually defuse any resentment and may even get their active cooperation. You may even be able to give them a free hand to describe how they fail.
Second best is to present them with overwhelming force. Yes, the rails will be visible, and you won’t get their buy-in, but you won’t waste their time lying to them about whether they’re really playing a scene where they can have an effect on the outcome, and they won’t waste any rare resources they might have in game trying to escape their fate. You’ll also avoid poisoning the game further down the road, where they’ll wonder (with good reason) whether every failure or setback they experience–or even every success–was manipulated by the GM. It’s not even like encountering overwhelming force is likely to be immersion-breaking, unless your PCs are nearly the most powerful entities in the setting; it’s common enough both in real life and fiction. It’s only in games (and in my opinion not very good ones) where everything is automatically scaled to your abilities and every obstacle can be overcome.
Trying to slip one past them so they think that they’ve actually played the game and made important decisions when you’ve secretly removed any possibility of that is, ime, the number one thing that players hate, and yet GMs keep coming back to it. Railroading is reviled by players, everybody knows that it’s reviled by players, everybody gives lip-service to the idea that you don’t want to be doing that to your players….but people still come up with scenarios that won’t work without it and try to devise cunning ways to hide it so the players won’t realize they’re being railroaded. Because, you know, the resulting story would be so much cooler if it came out the way the GM envisioned it without any player input but with the players unwittingly playing their parts.
If you actually think the players will believe the story is cooler too, then put it to them openly. If they think the point of the game is to make a satisfying and dramatic recap, they’ll be happy to cooperate. If they disagree, then you’re doing them no service by lying to them to get the story you want. And on the off chance they actually do think that it would be good if you sometimes disregarded their input to force the story in one direction or another, but they don’t want to know about it when it happens, then you can go back to worrying about how to camoflage your rails.
An excellent post. I completely agree.
Never plan a scenario where your players are required to fail. Always plan it so that the PCs win. When they fail (and they will fail eventually) then you wing it, adding alternate victory conditions or such.
If you’re worried about the PCs killing a major villain too early, then you simply don’t give them access to the villain early on. He doesn’t show up until its appropriate to eliminate him. He sends his minions and flunkies instead of appearing personally. Also, don’t rely on the PCs capturing the villain… if they do, great! Give them a cookie, but don’t require it for the story.