Bavuma suffered a calf strain while batting against Bangladesh last month and Aiden Markram stood in as captain for the second test as South Africa completed a 2-0 series sweep.
Ngidi suffered a hamstring injury, and made a comeback in the first ODI win over Bangladesh this week.
South Africa have also called up Lhuan-dre Pretorius, who had played two tests against Zimbabwe last year, after the 20-year-old impressed with a first-class century last month and scored a century against Bangladesh on Friday.
Pretorius has been released from the T20 squad ahead of the three-match Bangladesh series to prepare for the tests, with Matthew Breetzke replacing him, CSA added.
South Africa will kick off the three-match test series in Johannesburg on December 17.
Squad: Temba Bavuma (captain), Marques Ackerman, David Bedingham, Corbin Bosch, Tony de Zorzi, Zubayr Hamza, Simon Harmer, Marco Jansen, Keshav Maharaj, Aiden Markram, Wiaan Mulder, Lungi Ngidi, Anrich Nortje, Lhuan-dré Pretorius, Kagiso Rabada, Ryan Rickelton.
