The U.S. economy surprisingly accelerated to a 2.4% annual growth rate from April through June, showing continued resilience in the face of steadily higher interest rates resulting from the Federal Reserve’s 16-month-long fight to bring down inflation.