Is there a roadside workaround for a freehub that won't engage reliably? I had a lucky escape from a long walk on Saturday: 50km from home or 20km via a train, my freehub suddenly wouldn't engage - the pedals span as freely forwards as backwards.
I tried dropping the back end onto the ground to try to shake things loose, spinning the pedals hard both ways, etc. and had just given up and started scooting towards the station when the hub started clicking, so I checked and it worked - most of the way home. If I kept the pressure on it stayed engaged but struggled to re-engage; luckily when it gave up again I'd reached  rolling terrain so I could walk up and roll quickly down.
When I opened the freehub body, it had more mud than grease in it, and the balls look corroded though I won't be sure until after some more aggressive cleaning.  I haven't gone axle-deep in water on that wheel, and don't use a pressure washer but do use a hosepipe.  The seals were undamaged, and it's a Deore XT, just over a year old.
Is there anything that can be done at the roadside to keep going with a slipping freehub? I have quite a lot of tools, oil, and grease, and I can take the cassette off for access, but removing the freehub body from the hub takes a 10mm hex key (which I don't carry) and opening it takes a custom tool like a giant screwdriver, plus lots of leverage.  Would it have been worth trying to get some oil inside by lifting the seals?  Is there a creative workaround? I tried a friend's suggestion of cable-tying the big sprocket to the spokes and treating it as a very fragile variable-gear fixie, but the first gentle pedal stroke snapped all 3 cable ties at the edges of the sprocket.
Use strong cable ties or wire/cable to tie the biggest sprocket to the rear wheel spokes. This will eliminate the freewheel, so be very careful when slowing down or going downhill.
If cable ties are too weak, shifting or brake cables should work nicely. If you don’t have any spares you could even scavenge the front derailleur shift cable.
However, I think this problem is best treated with preventive maintenance and should announce itself quite early. If the sound of your freewheel changes or you notice it engaging slowly or failing to engage occasionally you should open it and lube it.