The two teams now head to Ranchi for the final match starting October 19.
The victory for India saw them beat the record of 10-straight home-series wins they share with Australia.
Anderson missed the majority of the recent Ashes series against Australia because of a calf injury.
Flower was appointed England assistant coach to Peter Moores in 2007 and took over as head coach two years later.
Maharaj, who made 72 with an injured shoulder, and Philander, unbeaten on 44, put on 109 for the ninth wicket to frustrate the Indian bowlers for 43.1 overs in Pune.
Mohamed Tanveer was adjudged the man of the match.
The Indian skipper surpassed batting great Don Bradman's tally of 6,996 runs.
Opener Faisal Javed Khan was the star for Qatar, blasting 61 off just 31 balls.
India were 273-3 when bad light forced an early end to play, with skipper Virat Kohli unbeaten on 63 and vice-captain Ajinkya Rahane on 18.
Hasaranga had Sohail stumped in the 16th over and then dismissed Pakistan skipper Sarfaraz Ahmed (16-ball 17) in the 18th to give Sri Lanka victory on a match day designated as Pink Day for breast cancer awareness.
The New Zealand-born cricketer responded to his wife's tweet with a face blowing a kiss emoji.
The star batsmen were both banned for a year for their roles in a ball-tampering scandal but have returned to Australia's Test, one-day and now Twenty20 sides.
Following India's 203-run mauling of his team in the first Test on Sunday, captain Faf du Plessis and Nkwe pleaded for patience as the squad rebuilds after Dale Steyn's and Hashim Amla's retirement.
Rajapaksa blasted 77 off 48 balls in an innings featuring six sixes and four fours after Sri Lanka won the toss and batted first.
The 44-year-old, who has spent the past two years serving as fast bowling coach under Bayliss, will take charge for the tour of New Zealand starting on November 1.