This is one of my weaknesses by a longshot. I think I have pretty decent aerobic capacity. I always ride flats atleast at 100rpm, anything lower just feels too slow. But the thing is after sprinting on flats, especially sprinting up a little climb or sprinting right at the top of a decently long climb (1-2mi is the longest climbs around here), I am absolutely done. My legs just feel extremely tired, then my heart rate sky rockets after sprinting, and I must take it down a notch, or two...or 10. I lose all my speed. The good thing is my heart rate drops extremely quickly after raising it but for 50-60sec after sprinting, i am wiped out
I think this has to do with weak leg strength, as I always spin on flats and if it is anything below 90 my legs feel like they are "really trying hard"
It has very little to do with leg strength. If you want to improve your anaerobic work capacity you need to do intervals that target these type of efforts. Do 10 repeats up that hill with 3-4 min of rest between intervals. You may need to adjust your effort so you can get through the 10 intervals.
Just remember that anyone doing an all-out 30-60 second effort feels gassed at the end. The goal is to be able to get up the hill only using 80% of your capacity while everyone else is at 100%. This can be improved by building your threshold power as well as your anaerobic work capacity.
You also need to train yourself to push through the pain and keep the power on once you crest the hill. It will be uncomfortable but you should be able to at least ride at your threshold power after a hard effort up the hill.
It has to do with recovery. That's what a big series of intervals stresses: your recovery system. Another good exercise is "over-unders." Go over threshold (but not sprinting) for a couple minutes, then under threshold for a couple minutes. Continue until you can't. You can also practice hill sprints. Find a hill that you can sprint up in 45 seconds, which isn't a true sprint but never mind. Do 6 of those with 5 minutes of easy spinning between efforts. Always stop an interval set when you do one that's slower. You'll gradually become able to do more of them in a set.
Of course sprinting spikes your HR. The trick is to train yourself to keep going anyway.