The tourists, set a near impossible victory target of 510, were bowled out for 300 just before stumps on the fourth day despite defiant batting from Younis Khan and Asad Shafiq.
The pair kept the Sri Lankan attack at bay for three hours to add 151 for the fifth wicket, Younis making 87 and Shafiq 80, before both fell on either side of the tea interval.
Off-spinner Randiv and seamer Kulasekara grabbed three wickets each to ensure Sri Lanka ended the match with a day to spare after Pakistan appeared to be taking the fight into the final day.
Randiv finished with seven wickets in the game, but it was team-mate Kumar Sangakkara who was named man-of-the-match for his unbeaten 199 in Sri Lanka's first innings.
J. Jayalalithaa passes away: Her life in pictures
Photos: Shah Rukh Khan, Deepika Padukone, Alia Bhatt at an awards show
Photos: Big B, Iulia Vantur at Himesh Reshammiya's album launch
Photos: Aamir Khan with 'Dangal' actresses at fashion show
Spotted: Twinkle Khanna, Shriya Saran at an event in Mumbai