Kusal Mendis starred as Sri Lanka beat Bangladesh in a tense T20, boosting his reputation after just 16 first-class games.