All praise is due to Allah. Salaat and Salaam be upon Prophet Muhammad (Salallahu Alaihi Wasallam) and his family members and companions.
The Celebrated Scholar Khatheeb Al-Shirbeeni (Rahimahullah) discusses about the permissibility of consumption and selling the fruits in burial grounds:
“If a tree grows in a burial ground, its crop is permissible to the people pursuant to the graveyard. Spending of it for the good of the graveyard is better than keeping it for the people”
There is no harm in Shari’ah in consuming or selling of fruits and trees planted by known or unknown persons in the graveyards. However, it is always best to sell the fruits and utilize the income for the burial grounds.
Allah knows best.
Wassalaamu Alaikum Warahmatullahi Wabarakaatuh.