I've done that, or roughly that distance, twice, in part due to living in the Yorkshire Dales. It's not ideal, is it.
Since then, I both a) replace the rear derailleur cable more often and b) carry a spare cable and adequate multi-tool.
The multi tool I have, with appropriate bit for that screw, is the Daysaver. Specifically, it's the Original9 with the Philips head bit swapped out for the flat head bit. It looks as if there is no longer an option for a flat head bit in the current version (Essential8), but if you search for 'Original9 Daysaver', there are a fair few around to buy still, and then you can add the replacement small bit from the actual manufacturer (
https://daysaver.fun/en-int/products/replacement-bits-original9 ), and the chain tool / spoke key add-on, which forms part of the device, also from the manufacturer (
https://daysaver.fun/en-int/products/bike-multitool-extension-coworking5 ). It's a remarkably neat, light and highly functional bit of kit, though not cheap as such. In use, it's way better than most multi-tools since the hex keys are full size, solid and not hinged with all the other bits hanging off and getting in the way.