ISLAMABAD—Two months ago, the coronavirus seemed to be spreading out of control in Pakistan, a poor, chaotic country of more than 200 million with a weak health-care system that was seemingly headed for disaster. It was being compared with Brazil, another developing country with a similar...