Help to improve a mesh for model that has features with huge difference in volumes

Hi!

I am trying to mesh a model that has 2770 grains with very different volumes, which are giving me troubles getting a good mesh with optimum number of elements. The model has ~6 million voxels and my goal is to have a brick mesh with not more than 2M elements.

I attached sculpt script I was using and got a good mesh but it has ~10M elements which is 5x more than I can have. I attached screenshot of the mesh so that you can get a perspective of a model and quality of mesh.

When I changed resolution from a script mentioned earlier (from 79-79-16 to 39-39-8) I got 1.6M elements but mesh quality drastically decreased. I attached screenshot of this mesh as well.
I would like to ask for help when it comes to getting a reasonably good mesh with ~2M elements. Is there any function I can add to my sculpt script? Any advice/feedback would be helpful.
Thank you!

Best,
Milica