Well I was being a little provocative. And as has been pointed out, it’s not a straightforward comparison.
However.... the sleeper is one of the few services in the country which has, largely, end to end flows (or nearly so) with few passengers joining at intermediate stations. To make things easy, we can assume that the electrically hauled part of the journey of the Highland sleeper has no carbon emissions, and therefore only consider the trip from Edinburgh to Inverness. What follows is very (very) back of fag packet.
I don’t have access to the figures, but I’d be surprised if the Inverness portion of the Highlander carries more than 80-90 people a night, on average. The 2 locos hauling it to/from Edinburgh will burn something like 400gals (educated guess) of diesel between them to do so, including that spent getting to and from the train and sat on it providing hotel power. That’s about 1500kg of diesel.
An A320neo flying Luton to Inverness with (typically) 170 passengers on board will burn about 3000kg of Jet A1, including that used for taxi-ing either end. Twice as much fuel, but for twice as many passengers, so (very) roughly the same.