India had already qualified for the last four and will finish top of the standings if Australia lose to South Africa in their last group match.
Sri Lanka, who failed to reach the semi-finals, slumped to 55-4 in the 12th over before Angelo Mathews smashed his first century in nearly two years to help them to a respectable 264-7.
Rohit and Rahul made a mincemeat of the Sri Lankan attack to add 189 runs, the highest opening stand at this World Cup, which effectively settled the match.
Captain Virat Kohli made 34 not out as India romped home with 39 balls to spare for their seventh win in nine matches.
Sri Lanka pace spearhead Lasith Malinga completed figures of 1-82 in his final World Cup match.
Earlier, Dimuth Karunaratne won the toss and unsurprisingly elected to bat in a rematch of the 2011 final between the neighbours.
Jasprit Bumrah rocked the islanders early with a two-wicket burst and Mahendra Singh Dhoni was busy behind the stumps as Sri Lanka lost their top four batsmen soon after crossing the 50-mark.
Both Karunaratne and Kusal Perera fell caught behind off Bumrah and Ravindra Jadeja did not have to wait for success in his first match at this year’s World Cup.
The left-arm spinner lured Kusal Mendis out of the crease for Dhoni, who was involved in each of the first four dismissals, to effect a simple stumping.
Mathews and Lahiru Thirimanne (53) refused to throw in the towel, though, their defiant 124-run stand raising Sri Lankan hopes.
Dropped on 61 by Bhuvneshwar Kumar, Mathews went on to complete his third one-day century, including two sixes and 10 fours, before Bumrah dismissed him for 113 in the penultimate over.
Sri Lanka toiled for 30 overs without success as Rohit and Rahul flayed their attack all round the ground.
Rohit smacked Dhananjaya de Silva for two sixes, the first one bringing up his 50, and reached his third successive hundred with a boundary off Kasun Rajitha.
The disdain they had for the Sri Lanka attack was best illustrated in the ramp shot Rahul played, bending back and lowering himself before guiding the ball over the wicketkeeper’s head to the boundary.
Rohit’s onslaught ended on 103 when he drove Rajitha to mid-off and Rahul’s 111 included 11 fours and a six.