Apple reclaims title as world’s biggest company as it races against Microsoft and Nvidia to a $4 trillion valuation