The increase in power consumption isn't really the number of pixels directly. It's more a function of an increased load on the GPU as it has to render a much larger image.
The other factor, and the more power hungry one, is size... A bigger screen has to push more light. The 2 XL has to light up about a third more surface area. I don't have any technical numbers but I suspect the difference in power used by the GPU between the two is far less.
In an interesting bit of symmetry, the 2XL's battery is about 33% larger.
Now, this doesn't mean the two will have the same battery performance of course, other than the screen, the two phones are identical... And while the screen is one of the major power users, it's not the only one. Ignoring the screen, the smaller pixel will drain it's battery quicker due to its reduced size.