Both tech giants are seeing tailwinds from artificial intelligence. But which one is the better long-term bet for investors?