XI’AN, China—This ancient city, famed for its terra-cotta warriors, is at the forefront of a more modern Chinese battle: for skilled workers.

As China’s economy slows, dozens of cities like Xi’an are ramping up efforts to attract college graduates from mega-metropolises like Beijing and Shanghai and to siphon engineers, scientists and executives from one another.

Exploiting...