Depends on whether you're counting distance or time. The longest distance service that runs regularly is Aberdeen to Penzance - currently Saturdays only, but resumes running Mondays-Saturdays from the May timetable change.
Occasionally engineering works mean that the train travels over an even longer distance than normal, and upcoming ones mean that there is, unusually, a northbound Penzance to Aberdeen service too, running via Toton, Doncaster and Leeds.
The longest service by journey duration is, however, the Caledonian Sleeper's Fort William portion whenever it runs via the East Coast Mainline. This results in an earlier departure from, or later arrival at, London Euston as the train reverses at Wembley Yard. Journey times average around 14 hours - about 45 minutes longer than the standard Aberdeen to Penzance timing.
I think this qualifies as the longest "regularly scheduled" service on the basis that ECML diversions are generally planned on an LTP basis for weeks at a time, rather than just ad-hoc.