I'm in year 11, I hang out with a bunch of pretty smart people. They beat me on SAC's and I rarely do the same, I do find it hard to sort of join in when they ask because it does become a lot awkward.
But then one of them might say things like, 'we'll definitely beat him anyway' , "surely he failed" , that just makes me more determined and adds fuel to the fire for me to learn.. Needless to say, I did beat him, albeit, by one mark haha..
If it's just people getting better marks than you and you're feeling down about it, take as a reason to study, a reason to show them you're just as capable as them if not more.
Or simply as motivation for you to do better. I find that sometimes, being beaten kicks you in the back and pushes you further.
The amount you study will show in your results so as long as you do as best as you can, study as hard as you can, you should be very proud of your result no matter what it is because it's your best effort.
Lipton said it imo, Self confidence is the key.