I think orochimaru may be the one that finally takes out madara. He will provide naruto with a kunai with the control seal on it. Naruto will manage to get past madara's defenses and implant the kunai in his skull while yamoto who is the sacrifice for madara will disrupt madara mentally. Orochimaru will then use the control kunai to disperse the edo tensei resulting in madara peeling away to reveal yamoto. Naruto will get one last moment with yamoto to say good bye before he dies. At least that was how I had originally planned to end my dead world arc concept.