Some people call a LOT of things railroading. I think that, in this instance, you were "railroading" in the sense that you were GMing a game... At least that's what I get there.
This is, of course, the best way to handle it. I'll additionally suggest that, instead of telling your players to...