Potential energy gained by climbing is very relevant – two identical riders of say 80kg (bike, kit and rider) gaining the same height have the same potential energy regardless of how the weight is distributed on their bikes. If we assume that they climb at the same speed, then they’ll have spent the same amount of energy moving air out of the way too.
Now, assuming that the law of conservation of energy holds for cycling as well as the rest of the observable universe (a stretch, I know):
Energy used = potential energy gained + energy used moving air out of the way + small rolling resistance (drivetrain, tyres etc)
Which is clearly the same for both. So if you’re climbing at a constant speed, it matters not where the weight is on your bike.
Now, for acceleration. Unless you are using your brakes on a climb, any energy you use accelerating a heavy rim will be returned in the form of slower deceleration. This is called the “conservation of momentum” and should have featured in your A-level in which you achieved a grade A. Now, if you start from rest and climb at say 12kmh, the lighter rims WILL save you some energy during this initial acceleration. And by “some”, I mean “really not very much at all in the grand scheme of things, about the same as a gnat tap-dancing for 2 minutes”. After that, its entirely* the same, because you’ll be travelling at a constant speed.
But wait – what if the gradient isn’t constant and you travel at different speeds for the same power output? Or you’re in a race and there are attacks and such? Lets say you’re travelling along a nice 5% section at 15kmh and happen upon a 10% section. Now, because the bike weight is the same, it takes no more energy to climb said wall due to total weight being equal – however the heavier rims have more energy stored so – wait for it - the heavier rims will release this energy as you decelerate and will actually get you to the top of the 10% bit ever so slightly sooner. I KNOW, RIGHT? However, once you get to the top of the 10% section it’ll take more energy to spin your rims back up to 15kmh. These effects will largely cancel each other out.
The only time when momentum is lost is when you use your brakes. A crit is the obvious example of something that requires constant accelerations and braking, but the wiki page calculates this and it turns out to be rather small. The other time it might be relevant is when Contador attacks and you’re scrabbling to accelerate onto his wheel and 2cm may well be the difference between winning the Tour or not – but I’m pretty sure that doesn’t apply to any of us on here FFS.
* As has been noted, because of dead spots in the pedal stroke you’ll actually be accelerating and decelerating constantly. Because of the conservation of momentum as outlined above, this is largely immaterial – but if we must cross the t’s, heavier rims will act like a flywheel and keep the speed ever so slightly more constant than lighter rims. Since air resistance varies as a function of speed SQUARED, lighter rims will actually take fractionally more energy to climb at a “constant” pace because during the power phase of the pedal stroke you’ll achieve a marginally higher speed. That said, I worked out the figure, multiplied it by the number of “what bike?” threads on BR and it was still less than the square root of bugger all.