They are related through rate or rotation (engine rpm) so for example a perfectly flat torque curve will always have a perfectly straight line for a power curve, the slope of the line is proportional to the torque (higher torque = steeper power curve)
This is a good example of this
Does the above make this more clear. Power and torque are not the only variables in the equation, rotational speed is also a variable.
The fact that the max torque/power is at different rpm gives a good indication that the torque curves are different for these engines due to the differences between engines and explains the difference in performance.
Using engineering units
Power has the units of Joules/Second
Torque is in Newton Metres
And rotational speed (angular velocity) is in radians/second
The equation is
Power = Torque x Angular velocity
Using the above units you get
Joules/Second = Newton Meter x Radians/Second
Whilst these units dont look consistent, Torque X rotation (Units: Newton Meter x Radians) is work done which has the unit of Joules. There is probably a way to prove this but I cant think of an easy one at the minute.
Hope this make things more clear