Pakistan win the test series with 328-run win