CHENGDU, China—For as long as Deng Wanyin could remember, the sprawling steel mill in the outskirts of this city has been a part of his life. The 42-year-old forged steel pipes here, as his father had before him. He met his wife in the apartments the state-owned mill provided to house its workers. Their daughter was raised in the mill’s schools.

One day in late March, notice came that the mill was shutting down.

“When...