In the first Test in Kolkata, Herath bowled only eight overs in seaming conditions, but was required to send down 39 overs in the only innings that India batted in Nagpur, after which he complained of back pain.
Leg-break bowler Jeffrey Vandersay has been added to the touring squad as Herath's replacement.
Sri Lanka, who were handed an innings and 239-run defeat by the hosts in the second Test in Nagpur, trail the three- match series 0-1.
The third Test will be played in New Delhi from December 2 to 6.
It was learnt that left-arm spinner Malinda Pushpakumara was Sri Lanka's first choice to replace Herath but the 30- year-old failed the fitness test.
The 39-year-old Herath is due to fly back home on Thursday.
Herath, who last month became the first left-arm spinner to take 400 Test wickets, has been ineffective on this tour thus far.
In the first Test in Kolkata, Herath bowled only eight overs in seaming conditions, but was required to send down 39 overs in the only innings that India batted in Nagpur, after which he complained of back pain.
Vandersay has played 11 ODIs and seven T20Is for Sri Lanka but is yet to make his Test debut.
Sri Lanka squad for 3rd Test: Dinesh Chandimal(captain), Dimuth Karunaratne, Dhananjaya de Silva, Sadeera Samarawickrama, Angelo Mathews, Lahiru Thirimanne, Suranga Lakmal, Dilruwan Perera, Lahiru Gamage, Lakshan Sandakan, Vishwa Fernando, Dasun Shanaka, Niroshan Dickwella, Roshen Silva, Jeffrey Vandersay.
Image (file): Sri Lanka's Jeffrey Vandersay (right) celebrates with Dinesh Chandimal after a dismissal
Photograph: Hannah Peters/Getty Images
As SA tour beckons, Ishant's resurgence a blessing for India
PHOTOS: Yuvraj, Sania celebrate Zaheer-Sagarika's wedding!
EPL: Improved Arsenal not out of title race yet, feels Cech
Ashwin is the best spinner in the world at the moment: Muralitharan
Blockbuster! India vs Pakistan in hockey opener at 2018 CWG