Alphabet Inc.’s Google has consolidated its artificial intelligence research groups into one unit, the company’s latest move to keep from falling behind in the AI race.