U.S. sanctions have pummeled Huawei Technologies Co.’s smartphone business. A different Chinese tech company is reaping the benefits. Xiaomi Corp. has filled the gap left by Huawei in markets from Europe to Southeast Asia to China. It is doing so with a playbook familiar to many Chinese consumer brands: offering functional gadgets comparable to upscale rivals at prices that often undercut them. No company globally sold more phones in the month of June, as Beijing-based Xiaomi surged past Samsung Electronics Co. , according to market researcher Counterpoint Research. For the second quarter, Xiaomi leapfrogged Apple Inc. to become world’s No....