The flashlight could be relying on the internal resistance of the AAA cells to limit the current through the LEDs and drop the voltage down to ~3V, or whatever the forward voltage (Vf) of the LEDs is. The rechargeable battery would likely have a much lower internal resistance, so be prepared for...