Google parent Alphabet Inc. is showing an expensive foray into artificial intelligence is starting to pay off, delivering better-than-expected sales for its cloud-computing business and driving more usage of its flagship search engine.