the power vs. rpm curve of an engine looks like an inverted parabola, while load curve (required hp vs car speed) would look like the right-half of an upright parabola ... if the two curves were drawn on the same graph (with appropriate conversion of rpm into speed at highest gear), the top speed would then be the intersection of the two curves

if we now assume that the two engines' power curves have similar shape except that one's peak power occurs earliear than the other, then it can be concluded that the engine with higher rated rpm will have higher top speed ... but it can be expected that the difference in top speed would be minimal because the load curve is typically very steep at high speed