What if he just performed a Konso on Madara. If he's edo alll you have to due is send the soul away from the body. Edo make Madara a plus in a physical body nohing more. After then I becomes Yamma vs. White with his bankai White is dead.
While characters like Yamamoto arguably can reverse an Edo tensei, I wouldn't assume Madara had it. That being said however, I can't see old man Yamamoto taking out both Madara and Whitbeard. Maybe 1 on 1 but not together.