I think Pakistan benefited from winning the toss. The pitch is ideal for a team batting third to bat the opposition out of the game.
Sri Lanka are now clearly struggling because of the scoreboard pressure.
Pakistan would have been in an almost identical situation had Sri Lanka batted first. However, the Pakistani batsmen deserve some credit for really driving home the advantage in the second innings.