Two 350 BHP engines can do the same amount of work per minute. If you think of the low-torque, high-revving gasser as a quick little fellow who can lift 100 16-pound bowling balls per minute onto a 2 foot high table, and think of the high-torque, low-revving diesel as a slower moving, but stronger weightlifter who can lift 10 160-pound boulders per minute onto the same 2 foot high table, then both of them have done 3200 ft-lbs of work in that minute (100 x 16 lbs x 2 feet, and 10 x 160 lbs x 2 feet), but they went about it in completely different ways.
(For reference, 1 BHP = 33,000 ft-lbs per minute, so both expended a little less than 1/10 BHP. )
(For further reference, there are 2 x pi radians per revolution. If you divide 33,000 ft-lbs/min by 2 x pi {approximately 6. 283}, you'll see where the 5252 comes from in the BHP = Q x N / 5252 equation. The 2 x pi function is used to convert rotating work to linear work. )
Edit: In my analogy above, the number of items lifted onto the table per minute equates to RPM; the weight of each item equates to torque insofar as the BHP = Q x N / 5252 equation is concerned.
Rusty