After a long push in Mexico, China’s Huawei landed a coveted job in 2017: supplying equipment for the country’s so-called “red compartida,” an ambitious telecommunications network built for carriers delivering the latest generation of technology. The contract came with a catch....