All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
If the ablution is nullified during the prayer, the prayer becomes void. The Prophet said: “Allah does not accept the prayer of one of you if his ablution is invalidated until he performs it [ablution] again.” [Al-Bukhari and Muslim]
Therefore, if a person is certain that his ablution is invalidated while he is performing the prayer, he should give up the prayer and perform ablution (again) and start the prayer from the beginning.
Allah knows best.