Thank you for your question. Generally there is no problem in buying the fruits and the money should then be spent by the mosque according to its legal constitution. If the mosque is a waqf buying and selling the fruits would be allowed, unless stipulated otherwise. So if the mosque is waqf for the benefit of those praying there then the money earned from the selling of fruits must be used for that purpose.
May you always be successful.