The main point:
The difference is that at Vx, you are getting the most feet of altitude for each foot over the ground. At Vy you are getting the most feet of altitude for each minute flown. It can be confusing thinking about the multiple variables in the problem. The reason you don't want to climb at Vy if you need to clear an obstacle is because sure you will get higher sooner, but you will also have covered much more distance because you are going faster. At Vx, the rate of climb is less than Vy (which can be confusing because then why do you use that speed to clear an obstacle?), but you are moving more slowly forward, so at a given point (like the end of the runway), you will be at a higher altitude than if you climbed at Vy and were at that same point.