Don't want to start an a vs. b war, but last time i checked the specs, the A340-213X (known as the A340-8000) had a range of 8000nm, more than any commercial airliner available today.
Older A340-200s (like the -311) are capable to fly 7450nm non stop, while the A340-313X fully loaded with passengers and baggage flies 7300nm.
The maximum range for the 777-200ER is, if i'm not wrong, 7150nm. Very close, but the 340 flies a bit farther.
Beside that, saying "superior" does not mean to compare the A340 to the 777 or A vs. B anytime, I even did not mention the 777 in my posting. By the way, there are other long range birds in the sky, like the 762/763ER, A332/3, some DC-10s, MD-11s and numerous 747s. And the A340 (as well as the 772ER, indeed) offer more range than most of them.