Who has precedence in honor: A father or an old person? It seems that the answer would be a father; (*) however, there is a midrash that implies otherwise:
שבשעה שהיו יושבין אצל קרח אביהן רואין את משה וכובשין את פניהן בקרקע, אמרו אם נעמוד מפני משה רבינו נוהגין בזיון באבינו וכבר נצטוינו על כבוד אב ואם, ואם לא נעמוד כבר כתיב מפני שיבה תקום, מוטב שנעמוד מפני משה רבינו אע"פ שאנו נוהגין בזיון באבינו
At the time that [the sons of Korach] were sitting by Korach their father, they saw Moshe, and they covered their faces in the ground. They said: If we will stand before Mosheh Rabeinu, we are disgracing our father, and we have already been commanded about kibud av va'em; but if we don't stand, it is already written "Before old people stand up"! It is better that we stand up for Mosheh Rabeinu, even though we are behaving disgracefully to our father.
The midrash continues and praises them for their decision. (They probably didn't consider the commandment to honor talmidei chachamim, because it wasn't commanded yet, because that is learned from "Fear את Hashem, your G-d," which is in Devarim.)
My question: How did honor of old people take precedence? Is this the halachah in the Shulchan Aruch that we go by? And what is more, not standing up would have been a "sheiv ve'al taaseh" (sitting down and not doing anything), and so would seem to be preferable.
So is this truly the halachah?
(*) The Taz YD 242:1 quotes the Tur that a rav gets more respect than a father because the father brings you into olam hazeh while the rav brings you into olam haba. An old person brings you into neither of them.