Alphabet Inc. is now worth more than Amazon.com Inc. for the first time in 16 months as the online-advertising giant’s strong 2021 stock rally continues.