Yeah, rereading some posts I have to disagree with the people saying YoRHa is a loop itself. YoRHa is a fairly recent creation, designed to give the androids on the surface a reason to fight, and therefore live.
The androids are all bound by programming, so short of culling them from existence and building new ones, there's no way to have the androids not all go insane and kill themselves than to have them keep fighting. They're programmed to obey humanity, but humanity no longer exists, so the only reason they have to continue living is the war with the machines.
If they lose that, they all die and earth is lost to the machines.
If they win, androids discover the truth about the human race and lose all moral and reason to live, due to not really being able to create new reasons to exist for themselves (like how 2B hates killing 9S, but can't actually stop).
Which in turn makes the ending as much of a downer as Nier's, now that I think about it. It's almost guaranteed that the androids, having lost their will to fight once more, will eventually all get themselves killed.
But I suppose that's why the pods were talking about how the future can change. It's not set in stone that androids will fail this time.