Like said, 400hp is 400hp. The difference comes with the RPM's that different engines make their torque, at. I can make 2200 ft lbs of torque, using a 10' long bar, much more than an IDI could ever dream of. But, the IDI will beat me every time when it comes to actually moving a load...but why is that? HP, the rate at which work is done. Torque and HP are related to each other with the given equation:
HP= Torque x RPM / 5252
If an engine makes peak torque at 1500 rpm's, and another at 2500 rpm's, to create the same amount of HP, the lower RPM engine will have to make 66% more peak torque than the higher RPM engine. Torque isn't exactly what its cracked up to be. Insert: 3.5 ecoboost vs 3.0 ecodiesel. Watch them on youtube pulling the ike gauntlet, and the ecoboost kicks the living chit out of the ecodiesel. But why? Both make about the same peak torque. HP. HP actually is what moves loads, people. The 240hp from the ecodiesel is no match for 350+hp from the ecoboost. At a given road speed, the ecoboost can develop more POWER, which is a function of RPM and torque produced, than the ecodiesel.
I-6's usually make torque down low, and have narrower torque bands. V8's have peak torque higher, and generally have wider torque bands. Ever wonder why a 400hp powerstroke/duramax will beat a 450-475hp cummins at the strip, day in and day out? Because of the torque band. When accelerating, the V8's produce power over a wider RPM range vs the I-6, which gives them an advantage when accelerating.
This is obviously way simplified, but it is what it is. Torque is a force, HP is a unit of power.