India scored 132 for five on a sluggish pitch, but the hosts overhauled the target with two balls to spare.
India were down and out at 193/7 before Chahar and Bhuvneshwar Kumar (19 not out off 28) forged an unbeaten 84-run stand to seal a memorable win for the visitors who extended their record of not losing an ODI on Sri Lankan soil since 2012.
Sam Curran was handed the man-of-the match award for his heroic 83-ball 95 not out in a lost cause, while England opener Jonny Bairstow got the man-of-the-series award.
The triumph over the No.1-ranked visitors augurs well for the Men in Blue ahead of the T20 World Cup to be held in India later this year.
The 30-year-old, who is recuperating at Bangalore's National Cricket Academy, will complete his rehab next month.
Bhuvneshwar sustained the injury while bowling the 19th over of Chennai Super Kings' innings during their October 2 clash here and hobbled out of the field after just one delivery.
Williamson was No.3 for SRH last season and this year, they may go for the fresh-faced Priyam Garg, India's captain at the 2020 U-19 World Cup, or the seasoned Wriddhiman Saha, in that position.
In a cheeky recent episode of 'Spicy Pitch', the usually mellow Bhuvneshwar opened up about his relationship with his wife.
The pacer will begin his rehabilitation at the National Cricket Academy in Bengaluru.
The right-arm bowler has been laid low by sports hernia, the latest in a series of injuries, which kept him out of the recent one-day series against West Indies.