Wind vs high altitude cruise
Simply a matter of fuel burn rate per time in air.  Generally you want to go as fast and as high as practically possible against the wind. (Indicated Airspeed - headwind) x Altitude factor = groundspeed (temperature, atmospheric pressure, humidity may be factored in too)

Trip Time hours = Trip Distance miles/Ground Speed miles/hour

Fuel consumption = Trip Time hours x gallons/hour fuel burn rate at given power setting 

The pilot may have thought the headwind would be just as bad at FL 240 as at FL 340.
Weather prediction is not perfect, but apparently they did take enough fuel along to make it.

I would give them credit for that.