I think the DRZ400E is around 40HP, the KDX is about 30. That said, the KDX is a lot lighter and depending on the rider, will smoke the 400 in the tight stuff.
Handling, talent&experience, and weight are bigger factors than HP if you are going to be riding trails in my opinion, and if you are riding tight trails and are of equal talent&experience, then you'll smoke him on the KDX as Speedy said.