The '03 V8 didn't have variable valve timing, so the HP rating was quite a bit lower. In fact, the V6 was rated higher in HP than the V8 until the V8 got variable valve timing. The 4.0L V6 always had variable valve timing.
Variable valve timing technology, VVT-i, VTEC, etc. tries to optimize both performance and efficiency. So what you're seeing is an increase in power, without a hit in effiiciency (MPG).
BTW, in '06 Toyota adopted the new SAE rating and testing procedures, so the numbers for both V6 and V8 are lower than '05. So for a uniform comparisons, look at Toyota's '03-'05 ratings. The V8 got VVT-i in '05. There's no drop in power, just how they are acheived are tested differently. Sort of like measuring a bottle of soda in qts instead of oz, same amount just one number is different than the other.