This may be different in some cultures, but among all my tribes culture and generally in my country, if it is very obvious that someone is older than you, like an elderly person, you supposed to greed the elderly person first. But there are some instances that the elderly person would have greeted you before you greet, that is also fine. If is not good not to greet an elderly person regardless of the person greeted you first or not greeted you first.
You just spoke what I had in mind. Greeting should be a sign of respect and courtesy, and even though it is most times believed by some race that since the elderly are older than the younger ones, the younger ones should show respect and greet the elderly first, but I feel even the elderly can also greet the younger generations, depending on the situation and who bumps into the other first. I can see someone I’m way older than, and greet them first, but in this case, I’ll expect them to return the greeting respectfully as courtesy demands.