Contrary to the common saying, there are many situations where the best option to proceed is to tell the players No.
Sometimes thing can go into such unexpected directions that it's just not possible for a GM to deal with it on the fly. When that happens, tell the players. You still can offer them two options: They can either chose to go with a different plan that you can manage right now, or they will have to wait until the next game to go through with it, when you had the time to prepare the new content.
Generally speaking, most players are okay with a fun idea not being doable right now, and they are fine with thinking of something else then. Though in some cases, when the game would end in 30 or 60 minutes anyway, and the plan sounds really fun, waiting until the next game can also be a really good way to proceed.
Gamemastering is not magic and you can't always get everything you want as a player. It's not bad to let players know about the limitations of the game. It's only railroading when you tell the players what they have to do. Sometimes reaching the edge of prepared content is in the nature of roleplaying games.