You're right that this is a subtle trick, because the amount by which the battery drains - in effect, how many molecules of battery chemicals react - is not something trivial enough to simply be transformed away by a reference frame change, and you can indeed use this to single out a "preferred" reference frame for the problem.
In particular, this special reference frame will be that of the Earth - and that should be a clue. Think about how the vehicle actually accelerates up to speed in the first place. Can it just do this were it simply floating around out in empty space? No! It needs to be physically contacting something to move across - and when you're on Earth, that thing is the Earth's surface (in a general sense). And this is what selects the reference frame you get. If you run it in empty space, the battery will still drain, but the wheels will simply spin uselessly and no problematic kinetic energy changes will occur. If you put the vehicle on another planet, like the Moon or Mars, then its battery will likewise "select" that planet as its "preferred" frame.
Of course, this is just one component of the problem. The other component is how do we reconcile the 4 joules, say, as being burnt by the battery in every reference frame, with yielding more or less joules in another reference frame? That is, if we shift to a reference frame where that the kinetic energy gain is only 2 joules, where did the other 2 joules go? And it turns out that if you work it out, the answer is they went into the Earth. They boosted its kinetic energy by 2 joules. Likewise, if we're in a frame where the kinetic energy gain is, say, 6 joules, the excess 2 joules beyond what the battery put in came from the Earth: in such a frame, the Earth looks like it slowed down a bit - note that with a suitably-moving reference frame, any "speeding up" object can be made to look like it's "slowing down", at least for a time, and conversely.
(Finally, note that you won't actually see any of these changes in Earth's motion in any reasonable sense. At a mass of $6 \times 10^{21}$ tonnes, a two-joule change in kinetic energy can at most change the Earth's orbit by about $10^{-29}\ \mathrm{m/s}$, which is roughly equivalent to a motion of about the size of a proton, over the entire elapsed span of existence of the human species!)