Imam Mahdi will refuse the ba'yah until the scholars around him remind him that the sins of the ummah will be on his shoulder should he still refuse to accept the khilafiat, then only he accepted the Caliphate duty. Allah Knows best.