I have been running a campaign now for twenty three years and have recently had to make some adjustments along the lines you speak of. My players all tend to enjoy roleplay more than rolling the dice and, in the past, I have even had situations where after setting the scene I could have left the room and not returned for several hours whilst they roleplayed amongst themselves. Now we are getting older, the available time for playing has become more limited and we have adopted the format of a weekend game every few months. Last year, a few of my players asked if I could speed things up a bit plot-wise. It wasn't something they blamed me for, after all this was their style of play, but as the GM I was in the best position to force things to move faster. We agreed that as a target, something significant (beyond roleplay) had to be achieved each weekend. So far, this has worked well, although I am still adjusting things and may well adopt some ideas from this thread.
I am in the fortunate position of having most of the campaign's major NPCs and areas already detailed, so I can react pretty quickly to changes of direction within a single session. To help this along however, I do ask at the end of a session what the group intends to do next (and will remind them what they said next time if necessary, although I would never force them to carry something through against their wishes).
I still have my major plot themes running: the overall campaign one and the long-term goals; but have set the next level down as small bite-sized scenarios aimed at working towards the long-term goals. Failing at something might set the group back, but won't generally completely mess up a longer-term goal, so railroading becomes slightly less important. I can also throw in side-adventures that have nothing to do with the main event (unless it seems to fit later of course...).
I would definitely discourage preparing lots of different things in detail. Better to concentrate on having a drawer-full of background info that can be used to ad-lib whilst the party is cajoled back to the prepared adventure. Never force them back, but usually treading-water in an ad-lib bit, whilst employing some of the "pull" tactics described elsewhere in this thread will work. If it doesn't, prepare another sub-plot adventure for the next session. You win some you lose some, and it is a good bet that there will be opportunity to throw them back at the "de-railed" adventure a few weeks later on.
A reasonably easy tactic for railroading, which may well prompt less resistance than others, is to get an idea what the group wants (e.g. an alliance with a nearby NPC lord), and then offer the means of achieving that via an unrelated adventure. Another NPC has the contacts to set up a meeting with the lord, or maybe has information on something which could be used to bargain with him, but first the group must carry out this little task.....
My biggest advantage is that the players know what I am trying to achieve, as they requested the change in the first place, and I have talked it through with them. As a group, we review progress after or between sessions too, so I keep getting feedback. Others here have said it, and I will echo it: communicate with the players and make sure that they are on board with changes. Some of the best advice on how to do this may well come from them.