well in sasuke's situation it makes sense why he was left out. sasuke was essentially a criminal for most of the story. he only did right long enough for him to help defeat obito, madara and kaguya. then after doing some good was hell bent on starting a dictatorship that would encompass the entire world as they know it. as far as we know, hamura didn't do any of that. he went off to watch over the moon and their clan. but it does acknowledge that naruto didn't do it alone, it says with the help of other shinobi. but lets be honest here, naruto did most of the work, therefore deserving most of the credit. you can't mention everyone by name.
I see your point, but in addition to history forgetting people, it can depict people in vastly different lights than they were in reality. This could mean it depicts them poorly, or perhaps in a brighter light than they should be. Naruto vs. Sasuke could be seen as a quarrel among friends where only Naruto knew of his true evil intent. If that was the case, Naruto beating Sasuke could go down as unimportant and only Sasuke's deeds in regard to defeating the Juubi and sealing Kaguya would be remembered, not his evil deeds.
My point here is that clearly Kishi summarized the ultimate villain as the Juubi (where Kaguya was essentially the Juubi plus a little more) and considering how things turned out for the good (in regard to Sasuke) the sealing of the Juubi is what will be remembered. Since Sasuke's role was critical to achieving this goal, you'd think he'd receive historical credit, but he received the same treatment as Hamura.
He is lucky that they didn't add that after sealing the jubbi the boy with the fox had to fight the other shinobi to save the world from him too and that's why seventh hokage was also known as Senju hand hokage.
One loses the credits when he has ulterior motives of his own on the side and is helping till he reaches in a position implement his personal plan too.
Right, Kishi greatly simplified the final arc in those short statements. About the ulterior motives again, the issue was immediately resolved and history isn't going to remember something that had potential to be bad, but turned out to be nothing. By that I mean I would bet on Sasuke's actions regarding the sealing of the Juubi/ Kaguya would be remembered over his planned dictatorship that only a handful of individuals knew he was contemplating and never came to be either.