Nearly $500bn has been wiped from the market value of global mining giants over four months, hit by falling commodity prices and cooling investor sentiment around AI.