Travelling by road, does not require sticking on the rails. If anything happens ahead of a road calvalcade whether accidental or deliberate, a road convoy can quickly turn round and retrace its steps and reroute - and the country is riddled with roads of all sizes. It is also much easier for police to have police cars patrolling the road, watching what is happening either side and guarding junctions.
With trains this is much more difficult. Railways run through all kinds of countryside sometimes close to roads, sometimes through heavily wooded and rough country, often through farmlands and villages. It is crossed, over and under in so many different ways. It would be impossible for the police, or even drones to properly surveille it.
One of the main railway lines runs through our village, just clipping the corner of our garden. Through most of the village gardens, run up to the rail, there is a foot path, lane, farms all abutting on the railway. Bot to mention 2 level crossings and two bridges.
All it requires is one lorry to deliberately drive into the side of a bridge after the train has started or someone to drop something heavy concrete blocks, on the rails, possibly an hour before the train is due through but when it is on the way, and you have a major cock-up that blows a hole in the tight time table. Trains cannot turn round, go back a few miles and resume their journey. Some times the nearest alternative route could mean taking the train back 50 miles or more. You cannot stop traffic on every road that crosses the railway for a day in advance the chaos would be too much.
On our line, if a lorry blocked a level crossing or drove into the side of a bridge, or a local farmer drove his tractor onto the line from one of his fields, the train could have to go back 65 miles before it could be re routed, it might have to await another engine to help with the reverse journey. The delay could take up to a day out of a tight schedule.
That is why the Queens coffin did not travel down from Scotland by rail and will not travel by rail to Windsor.