In this situation, grades are more important than "friends", especially ones like that. If they can't bear to see you achieve, especially after what you've been through, then they were never true friends and they will not be part of your life in the long term. Try and fast forward a few years. Would you rather look back and be proud that you achieved great results despite those idiots? Or would you rather look back and think you could have done better, but you wasted time trying to be friends with people who weren't worth it?
School is a pretty tough time because it becomes your entire world, so it's easy to lose perspective when it comes to peer pressure and wanting to be accepted by people. But as soon as you leave school and go out into the world, it's completely different. This starts to a certain extent in sixth form, when people begin to realise that if they want to get into a good uni, they have to get good grades, and you can be friends with people like you who want to do well. When you get to uni it's even better because there are so many people around you really can't fail to find some people who are on your wave length.
So even though it's not particularly pleasant right now, get your head down, work hard and think, "**** this. I'm better than them!"