Friends come in all shapes and sizes, you don't have to be of the same age. At school, you may find a large imbalance on your friend list on that regard, and only a few know that similar behaviour with both troops will only lead to war. Here's how you can be with them both, keeping your integrity intact.
Respect
With the big ones:
The word carries a lot of weight to them, specially from you as you will always be seen as a minority. In school, every differentiable factor is thought of as either an advantage or disadvantage to make any party feel superior. No matter how close you may be to them, you will still be a class below, but don't worry, that won't change how they act with you if they respect you, but that's only if you do so as well. Now the idea of respect may be hazy at that age, but be careful about how you behave when their friends are around. Talk to them on an equal ground, knowing and showing that you know full-well you're junior to them, and let them take charge when they wish to. That factor alone cancels out all target-able differences and leave you as an equal.
With the little ones:
You should know when they are crossing lines or taking advantage of you. Hence, keep them at a distance, just a bit, so you may retain your superiority and respect when in front of their friends. But one thing which would flood their morale is not considering or calling them as “little brother/sister.” It gives the vibe that you like them just for who they are, despite age differences.
Favours
With the big ones:
You may seem bound to act when a boro bhai from school asks for a favour, but always retain your importance in these situations. If it is something you are uncomfortable with doing, politely say no to the situation and if required, explain how it is not possible for you. If you are still pushed to do so, maybe keeping ties with someone like that isn't worth your time at all.
With the little ones:
On the flip-side to the situation explained above, it would be unfair to ask your junior friends to do things for you just because. The aim is to make them feel like they are on the same level as you, and understand s/he also has his/her own reputation to maintain. Hence, act accordingly. It is advisable that you know that if a word of mouth spreads of you taking unfair or unethical advantage, it would probably lead to junior classes having a bad impression of you.
Humour
With the big ones:
This one may be tricky, but keep a leash on the humour before it becomes an insult to your seniors, especially in front of their friends. Laugh along. Add a subtle fuel to the fire, but only understanding your relationship and situation well. A second impression implying that you would rather make yourself look better by putting your friend down might not be well received.
With the big ones:
Even though the final limit on impulsive humour may be more with your juniors, it would still be advisable to watch what you say. A sting is still a sting, and there is always a number of those who will react. Try to laugh with them, not at them, and all shall be well.
Personality
With all:
This would eventually be the test factor to see if you are compatible with both ages, bigger or smaller than you. Your personality must be consistent, and that reflects directly on your behaviour. If you are entirely different with each party, it means you are not being real and changing yourself to be liked by both, which we're afraid, will eventually get you busted. If you wish to test this, hang-out with both at the same time. Bottom line is, be yourself and you will get the best of both worlds.
However the third world in this scenario consists of equally aged peers. A simple fact – if you don't have much friends in your own class, unless you dropped or skipped a grade, it wouldn't be advisable to go chilling with your juniors or seniors which, in both cases, will leave you looking like a minority.