Demand for critical minerals is expected to boom to meet the energy transition, but investment in new mines remains sluggish.