A five-year truce between rivals Alphabet Inc. and Microsoft Corp. came crashing down in 2020 when the tech giants found themselves at odds over their competing web-search businesses, according to testimony at the U.S. government’s antitrust trial against Google.