Pakistan defeated Sri Lanka by four wickets in the first Test at Galle, while it registered a dominant innings and 222-run victory in the second Test at Colombo.