That’s only true because the throttle is open more when you are going up a hill at 1000 rpm than in neutral at 2000 rpm.
At a constant throttle opening, the slower the engine turns, the less air it sucks past the throttle and the less air it sucks past the throttle, the less gas needs to be added to the airflow to maintain a stoichiometric air/fuel mixture.
Modern EFI systems automatically either open the throttle or the idle air bypass a little to compensate for the additional load put on the engine by putting the transmission in drive or turning on the AC or even the headlights and the increased load is reflected in the idle fuel consumption. In my car, turning on the AC actually increases the idle rpm by a hundred rpm or so.
Old low tech carburetted V8 engines used a constant throttle opening at idle and the engine just slowed down a hundred rpm or so when you turned on the AC and I’m pretty certain that this resulted in a slightly lower idle fuel consumption. Ditto for keeping it in drive.
However, these old low tech very large V-8 engines probably burned nearly a gallon of fuel per hour just idling with no load.
A modern Toyota Yaris engine burns about 0.16 gallons per hour idling no load once the engine is fully warmed up.