Every Shinobi in the alliance needs to foresake themselves and attack without fear, the alliance is falling back because they say the battle is getting "too intense", which they should've expected, being up against The Juubi, the juubi's jinchuuriki, and now a possibility of a second Juubi Jinchuuriki.
They need to work out a strategy to separate Madara from the Mazo, first off, then if* the Juubi revives again, they need to keep Madara as far away from it as possible.
Then they need to split in half. Half of them will take on Madara, while the other half takes on The Juubi (or Mazo if not revived ), or divide into parts that accommodate the situation.
However, Madara takes priority over the mazo, as he poses a far greater threat by trying to become it's jinchuuriki, so they will need to put more advanced Shinobi against Madara, while putting Shinobi to atleast ward off the Juubi ( or Mazo ) for as long as possible.
They also need to stop at nothing to make sure Madara does NOT get his other eye, meaning Kakashi and Minato need to take care of Zetsu right away and destroy the Rinnegan in Obito.
After doing this, I see Hashirama recovering and revealing that his sage mode does have a "weakness" Madara is un-aware of, or maybe even have Madara exhaust all his senjutsu chakra, leaving him how he was when he revived + one Rinnegan.
Now that Madara is without Sage mode, he will need to become more aware, as he no longer possess healing abilities, making it that much harder on Madara, now that he can no longer take any attack without consequence.
So, a living Madara with only one Rinnegan, at this point, Kishimotot could make an ending, without thought.