Why is railroading always talked about in negative context? Some groups enjoy railroads. Good DM can turn railroad into roller coaster. It twists, turns, goes up and down, but it always stays on track and doesn't allow for deviations.
You can also enforce those rails by social contract. I'm familiar enough with before mentioned Masks, but decent amount of CoC adventures are linear and railroady. If i say i'll run CoC adventure Horror on Orient express and player say they want to play it, then we are playing that adventure. If they decide to exit train at one of the stops and never to return to train, then they are breaching that deal. Can DM wing it? Sure, if he is experienced enough and has talent for improvisation. Personally, i would just end game then and there. We had agreed to play Orient Express, not my home brew game. For whatever reason, you decided to exit from planned adventure, which is totally players right. Maybe they got bored of it. Again, cool. Let's end it and play something else.
Are you saying the Orient Express is on rails????
(waits)
(hears crickets)
Tough crowd.
I think it depends on whether you are upfront about it. A railroad where everyone is aware that and buy into a conceit of the adventure (the adventure is on the train; you leave the train, you’re leaving the adventure) is fine. A railroad in a game where you give the illusion of choice is bad.
I think most campaigns are actually never fully sandboxes and never fully railroads. They shift between the two. I’ll use Ravenloft as an example. You know that you need to kill Strahd. How you do it is up to the party. But nopeing out of the adventure isn’t possible. There’s a choking fog surrounding the village and castle that will only be lifted if you slay Strahd. Now, you as the DM could easily change that - you just have to be prepared to shift if the party says “Nope, Strahd’s gonna kick our butt. We’re outta here.”