Mathews top-scored with 87 off 90 balls while Mendis added 54 off 58 balls after skipper Dimuth Karunaratne won the toss and elected to bat first at R. Premadasa Stadium.
Dasun Shanaka made 30 off 14 balls to give Sri Lanka a late impetus as they added 53 runs in the last five overs after Mathews and Mendis put 101 runs for the third wicket.
Bangladesh got an early breakthrough when Shafiul Islam removed Avishka Fernando for six but Karunaratne (46) and Kusal Perera (42) steadied the innings with an 83-run stand.
Left-arm spinner Taijul Islam removed Karunaratne to break the partnership and Rubel Hossain got rid of Perera in next over to bring Bangladesh back into the contest.
But Mathews and Mendis snatched the momentum back thanks to some sloppy fielding by Bangladeshi players.
Mushfiqur Rahim dropped Mathews on 32 off Shafiul before Sabbir Rahman gave the former Sri Lankan captain another life on 63 off Mehidy Hasan's bowling.
Mathews who hit eight fours and a six was finally dismissed by Soumya Sarkar in the last over but not before Bangladesh reviewed a caught behind appeal initially dismissed by on-field umpire.
Soumya finished with 3-56 while medium pace Shafiul also claimed 3-68.
The island nation's cricket board has dedicated the match to pace bowler Nuwan Kulasekara who announced his retirement last week.
The Tamim Iqbal-led Bangladesh wore black armbands to pay respect to their first national captain, Shamim Kabir, who died on Monday.