Australian mining giant Lynas will sell rare earths to Japan for 12 years in a major pact meant to chip away at China’s dominance of the global market.