It is really dependent on a lot of things like the type of high school a person went to. My friend currently attends a tough elite magnet school in which all classes are honors level and good grades are hard to come by, kids have to work for their grades and usually a lot of the kids drop out. Those who drop out excel at regular high schools.
So who is to say that someone ranked outside the top 10 percent at an elite level high school is not smarter than the valedictorian at a district public school?
Next, doing good in high school gets you into the top colleges. Well I attend Cornell and I have seen some students flunk out already and they were at the top of their class when they came here. Getting into a good college does not write a story with a happy ending for you, as a student you have to work twice as hard so you can keep up with the competition there (at Cornell I rarely have time to talk to my old friends, I waste my time on here some days because I want a break).
The most important factor also is upbringing. You cannot expect a kid growing up poor to get ALL A's and get a 2400 SAT score, it is difficult to do. A rich kid has parents who can hire tutors and put him in prep courses so for a rich kid to get into Harvard, well that is expected. Could that same rich kid last in a poor kid's shoes?
"Do you guys think that those who graduate at the top of their class in high school will eventually live a good life?"
No, there is still a lot of room for error and a lot of room to trip up.
"Also, do you guys think that someone who did average in high school still get into a top university? (as a transfer or for grad school)"
Yes, Obama went to Occidental and then transferred to Columbia. I have see some transfers here at Cornell already who have made it here from colleges you have never heard of. Not to mention that Harvard Law has students from Oral Roberts University (look up the stats on their website).
"Would a student be better off excelling in high school but doing average in college or doing average in high school but excelling in college?"
Average in high school but excelling in college is the way to go. Even for some careers which only require a bachelors, you can still transfer to a better university after your second year so high school excellence is useless in most cases, it gives you a minor leg up, that's all.
By the time we graduate from high school, we have not accomplished anything in our lives. Academic excellence in high school means little to nothing because of the disparity between high schools.