So it seems you have 8 days yet to nail down plans for, including the few days in Salvador you mentioned (but not including 4 days in Rio including the arrival day, 4 days in the Chapada, 3 days for the falls and your day in S.P. before flying home), so maybe 5 as yet unscheduled days.
What you need to do is some serious research into the weather—in the places you mentioned, and at the season you have chosen—and not assume that all of Brazil is perpetually warm and sunny. And because of changing or unpredictable conditions, you may have to be somewhat flexible and be ready to change plans on the fly.
Factors to take into consideration:
In many years, April in Salvador can be constantly rainy, with few breaks, although quite warm. The beaches in the south of Bahia (300 miles away) are usually in a different climate area, though, as is the Chapada Diamantina (200 miles away from Salvador; May-Sept has the least rain there). Beaches and states further up in the northeast also have different climate areas than Salvador, some with rainy season at slightly different times.
Right now, there is a drought in much of the country. Sao Paulo is talking about severely rationing water—5 days without (probably not applicable to hotels, but who knows). Rio is also effected, with very low water levels in the Lagoa, a city landmark. It has been in the 90s (F) to 100s in many places.
Other thoughts:
You will not have sufficient unscheduled time on your outlined plan to worry about “flexibility for remote beaches”. So don’t consider driving, simply for that reason, as well as other sound reasons.
There is an overnight bus from Salvador to Lencois that would be a good option for your Chapada visit.
The direct bus from Rio to Salvador is 21-24 hours. Fly.
With your 5 days, you might want to fly from Rio to Porto Seguro (or bus to Victoria/Vila Velha and on to P.S.), explore that area (Arraial D’Ajuda, Trancoso, Caraiva) for a few days and either fly or overnight bus to Salvador. Or explore some beaches around Salvador, like Guarajuba, Praia do Forte, Morro do Sao Paulo, Itaparica, Boipeba. Or get out of town if it’s rainy and maybe bus to Recife, which may have better beach weather at the time. Or spend time nearer Rio in Paraty/Trindade and Ilha Grande, which may have different weather. The catch is that last minute flights tend to go up in price vs. buying well ahead. Bus prices are stable though.
Happy travels.