They are not. The Mahdi myth directly contradicts Who the Christian Messiah is. The Mahdi myth claims the Mahdi will turn the world Muslim and that Jesus will be his sidekick, slaughtering all who do not turn Muslim, including Christians devoted to Jesus. It is absolutely impossible that they are all the same person being waited on.
Jesus is a prophet of God, the promised Messiah to the children of Israel who rejected him, so he will return at the endtimes to defeat and kill the false-messiah accepted by the children of Israel.
He will show all the wrong things inserted by men in the bible without authority and they (christians) will embrace Abrahamic monotheism.