Newmont Mining has agreed to sell a 14 percent stake in an Indonesian gold mine for $494 million, ending a years-long dispute with the Indonesian government over how the mining company should sell shares as required under its contract to operate in the country.