Sir if you are taking all your facts from E. E. Zaheer's book without knowing the background and details of this episode then you have done a great injustice to yourself.
The first thing to keep in mind is that Mirza Ghulam Ahmad's challenge to Sanaullah Amritsari can be traced back much earlier to 15th November, 1902, when his book "I'jaz-e-Ahmadi" was published. In it he clearly stated:
اگر اس چیلنج پر وہ مستعد ہوۓ کہ کاذب صادق کے پہلے مرجاۓ تو ضرور وہ پہلے مریں گے
"If he accepts this challenge that the liar should die before the truthful one, then surely he will die first." (Ruhani Khaza'in v.19 p.148; I'jaz-e-Ahmadi p.37)
So we safely conclude from this that according to Mirza Ghulam Ahmad, the fact that the liar will definitely die within the lifetime of the truthful is subject to the condition that Sanaullah Amritsari first accept this maxim, so that it can be a heavenly sign, and in the aftermath no party should make any objection that they don't accept the outcome because they don't agree with its premise.
Now you have quoted Mirza Ghulam Ahmad's supplication from E. E. Zaheer's book from 15th April, 1907, but ask yourself why didn't E. E. Zaheer likewise quote Sanaullah's response to this supplication? For your benefit I will quote Sanaullah's response from 24th April, 1907 in his Ahle Hadith periodical:
First: "I never agreed to such a prayer, and without my consent this prayer was published." Second: "This subject was not published by way of Ilhaam rather it is said that this is not a prophecy by way of divine inspiration but it is merely a prayer." Third: "My grouse is with you (Mirza Ghulam Ahmad) if I die what evidence could that be to other persons?" Fourth: "You have been very clever (to have prayed for death by plague) having seen that nowadays the plague is raging moreso in the Punjab. And in the Punjab especially the capital Lahore which is so near Amritsar (where Sanaullah lived). Fifth: "Your prayer can in no way settle the matter because a Muslim dying by the plague according to a Hadith is considered a martyr, so how by your prayer can a plague-smitten person be known to be a liar." Sanaullah concluded by saying: "In short, according to your request, I am ready to take an oath if you would disclose to me the outcome of this oath. And this writing (i.e., this prayer of yours) I DO NOT ACCEPT nor can any sensible person accept it."
Not only that, but in the margin of the very issue, the assistant editor appended the following text which was later on also testified as true by Sanaullah. The assistant editor wrote: "God gives long lives to those who are liars, deceitful, mischievous and disobedient so that during the time given to them they can do more of their evil deeds."
Sanaullah himself wrote: “Despite being a true prophet, the Holy Prophetsaw passed away before Musailma Kadhab, and even though Musailmah was a liar, he died after the truthful one” (Muraqqa-e-Qadiani, April 1907, Page 9)
So because of Sanaullah's rejection of the challenge, which was conditional to his acceptance of it, it was cancelled and subsequently Mirza Ghulam Ahmad died in 1908, while Sanaullah lived longer, which according to his own criterion made him the ultimate loser since "God gives long lives to those who are liars, deceitful, mischievous and disobedient so that during the time given to them they can do more of their evil deeds."
Remember that a Mubahala has to have both parties consent. The Christians of Najran refused to enter into Mubahala with the Prophet because they knew in their hearts he was true. The Prophet remarked that had they actually entered into the contest, they would have been utterly destroyed and made an example of. This proves that Mubahala has to have both parties active involvement in order for it to take effect. Since Sanaullah clearly refused to participate, therefore he was spared the effect like the Christians of Najran.