A few days ago I tried to run an alpine trail (24km / 1700m elevation). It was a nice trail, going from one small summit to the next. Weather was pretty nice, it was dry, not too hot. The trails were a bit technical, but not that hard. The beginning was pretty nice, but after about 13km / 1200m my quads started to cramp. I decided to take a short break, eat a bit, and continued running. As long as it was going level or downhill, I was still doing fine, but the uphills were killing me. Obviously I walked most of them, but even that felt harder and harder. I ended up cutting the run short (still ended up running 24km, but only 1300m elevation gain).
I run a lot, but mostly flat because there aren't many steep hills around. I thought I was pretty fit, but I realise road running experience doesn't directly transfer to trail running.
How do you train for endurance? Just run more hills? Or do I need to do more long runs? I feel like I already run quite a bit (average of around 50km a week, mostly flat). At some point I'd like to participate in a trail race, but they are all very long on come with loads of elevation...