Addressing inequalities in medical workforce distribution: evidence from a quasi-experimental study in Brazil