The inflation rate hit 2.5% in June, exceeding the Bank of England’s target for a second month.