I think you have already answered your own question.
The aircraft flying at Vy (best rate of climb speed) will get to 5000 feet before the aircraft flying at Vx (best angle of climb speed) but it will cover more ground in doing so.
Vx results in a steeper, slower climb while Vy gives a faster, shallower climb.
The POH will provide the relevant speeds for a particular aircraft.