Inflation eased in June to its slowest pace in more than two years, but remained above the Federal Reserve’s goal.