The best way to prepare for a real life situation is to train the same way, at least mostly. So, in your specific case, You should start by climbing stairs. You don't have to climb the same amount as will be in the competition, but start gradually and work your way up. Since this competition is about
So you should train those aspects in that order. I say that order because you can't finish if you don't have enough endurance or strength, no matter how long it takes, and strength means nothing if you've 'maxed out' by the second flight.
Train the primary muscles
This includes climbing actual stairs, as well as the stair stepper at the gym. Given the choice actual stairs are your best option, as they directly relate to what will be required for the competition. One or two stairs isn't really relevant at this point, because you will be focusing on cardio, legs, and glutes, and it will tax you :-). The point of this section of training is to get the primary muscles ready for the competition, to make sure they are physically prepared to go the distance, and they will know what to expect.
Train the secondary muscles
Secondary muscles are sometimes overlooked unfortunately, but this would give you a slight advantage against other competitors who don't train them. Often called support muscles, these are the muscles that help the primary muscles function. Think of how a bench works (primarily)chest and triceps, but secondarily works the shoulders and traps. The secondary muscles in your case could be abs, calves, and even shoulders -- if you swing your arms back and forth when you step.
Bottom line is, you should see slight to decent improvements when training if you work these muscles outside of primary training. This doesn't have to be super-intense or heavy training, light-weight high-rep training is fine, this is endurance training which is exactly what you want.
You'll notice I didn't speak much about endurance speed and strength training. There's info on the site about training in this fashion, but to summarize:
Endurance training involves mostly low intensity and long duration. For your particular application, start the stairs slow and make completion your goal.
Strength -- To put it simply -- is the polar opposite of endurance. This high intensity short duration. There are some merge areas between strength and endurance where you'd work both, but that's out of scope here. For your application, this is where you'd pick the amount of stairs you want to climb at once. On one extreme, you could jump 6-10 stairs at a time (or however many your stride length allows), but the duration would be extremely short. On the other extreme, you could stick to one stair at a time. You'd have to find your own sweet spot, but as you found out, endurance is key so strength should be an afterthought.
Speed -- 'nuff said.
Hopefully this helps future visitors also, as well as your training for next time.