The hosts reached the below-par target of 137 to win by losing only one wicket and 21 balls remaining at Gaddafi Stadium in Lahore on Saturday.
Skipper Babar (66 off 44) smashed seven boundaries and one over-boundary while Hafeez hit nine fours and one six to score 67 off 49.
Opting to bat first after winning the toss, Bangladesh set the hosts a target of just 136 in the decisive match.
Opener Tamim Iqbal was the only bright spot for the Tigers in another sub-par batting performance as he smashed 65 off 53 for the visitors.
The only other batsmen to hit double-figure runs for Bangladesh were Afif Hossain (21 off 20) and skipper Mahmudullah, who scored a run-a-ball 12.
Bangladesh made one change to their line-up as Mahedi Hasan came in for Mohammad Mithun while the hosts named an unchanged team.
The Tigers came into the crucial encounter on the back of a hard-fought five-wicket loss in the series opener.