SINGAPORE—As American tech giants pull ahead in the artificial-intelligence race, China is turning to an old playbook to compete: putting the vast resources of the state behind Chinese companies. But the heavy hand of China’s government is also threatening to hobble its AI ambitions, as Beijing puts …