All perfect praise be to Allah, The Lord of The Worlds, and may His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
An endowment (Waqf) is among the channels of charity. Not only that, but it is the greatest type of continuous charity whose reward continues for its donor and it is recorded in his good deeds even after his death. In one of their opinions, the Hanafi as well as the Hanbali jurists stated that it is allowed to endow money for charity. In his commentary, Al-Imam Ibn Abdeen stated: "When people dealt in endowing dirhams and dinars, at our time, it was based on Mohammad`s opinion, which we adopt." {Rad Al-Mohtar, vol.6, pp.434)." It was reported that Al-Imam Ahmad said: "It is permissible to endow dirhams" {Al-Ensaf, vol.7, pp.11), Al-Merdawi}. Since the ownership of the endowed money doesn`t belong to a certain person, it isn`t allowed for the donors of the amount mentioned in the above question in addition to any other donations to take them back because the endowment is in effect. Therefore, they must be spent on the Masjid.
In addition, no Zakah is due on money endowed for the interest of Muslims because it isn`t owned by a certain person. It is stated: "No Zakah is due on….. cash bequeathed for charity, for purchasing an endowment because it isn`t owned by a certain person." {Oli An-Nuhaa,vol.2, pp.16} * a Hanbali book.
In conclusion, no Zakah is due on the money mentioned in the above question. And Allah Knows Best.