Positions are based on a few things: work ethic, effectiveness, ambition, attitude, experience, and reliability.
Not everyone likes this, but if you aren’t self-employed, you basically have no choice but to accept it. Some people refuse to accept this reality and get angry when they find someone younger than them moving above them or taking their spot. This just creates difficulty for everyone. Not only are you unhappy, but you are now making the person in this higher role uneasy (and undeservedly so.)
You can choose to feed your pride and say it isn’t true, but it only makes sense that age/loyalty does not constitute position. Why? Because companies are trying to get work done, not build a family. The status of grandma or grandpa/mom or dad holds weight in your home, but it doesn’t in the land of getting things done.
This means that, sometimes, people that are significantly younger than you that have less experience will move up past you because they have the other traits the company needs (like reliability, ambition, and work ethic.) It only makes sense. Companies are in the business of making money, and you are not entitled to promotions only out of loyalty.
However, if you want to be the one moving up at your job, here are some things to consider: what does your company value most? In what ways can you improve? There are easy things you can do to help improve your reputation where you work, like always trying to show up 5 minutes before your shift starts. You could make an effort to smile more and say hi to everyone. Maybe wash and iron your work uniform and try to look your best. Take that extra shift someone is trying to give away. Simple things can help your reputation and help you get promotions.
Now, if you want to be the younger one moving up at your job, you have to be going all out. You need to be producing while you’re on the clock. If you’re done with what immediately requires your attention, find something else that has to be worked on. Think ahead, pay attention to your surroundings, stop problems before they happen. Make connections, communicate with your higher ups. When the people higher than you see you always working and finding intelligent solutions to problems- they’ll be dying to promote you.
In conclusion, if someone younger than you moves up past you, don’t let your pride swell up and take over. It's nothing personal; they're probably doing something that gives them the right to have that spot. If it really bothers you, let it motivate you to be more productive and work harder.