It was not to be as Razzaq and Moin supervised the run chase over the closing overs, with Razzaq ending the match in style by on-driving for four to bring up a 52-ball fifty.
Mahmudullah hit some stylish shots in his career-best 108-ball 69, the 23-year-old's maiden fifty in only his third Test, before being caught behind off paceman Sreesanth attempting to guide to third man.