Beijing’s decades-long push in rare earth mining paid off, helping secure a tentative US trade truce after easing export controls.