Densities with the mean value property for sub-Laplacians: an inverse problem