2 lithium ions at 8.4v are close-enough to 6 AAA's at 9v. The only issue is internal resistance. The lithium-ions won't voltage-sag under load, like alkalines will. So, those 6 AAA's might really only be delivering 7v under a heavy load. If the flashlight is a piece of junk, and is relying on that battery internal resistance to limit current, then you could fry the light if you try using 2 lithium-ions.
But, at least you won't ruin a good light. Give it a try and find out. Worst case is you get to buy a better light.