Brazil is a country with a lot of tropical rainforest. Many areas are quite unreachable and in earlier days some places could only be reached by boat. That is why some cities exist: Especially the Portuguese colonial masters arrived with their ships at the coast and had to walk into the mainland to find gold (for example in Minais Gerais).
Later on, a railway track has been layed through the mountains. And only in 1985 the Rodovia Rio-Santos has been opened. It runs mostly along the coast from Santos, close to São Paulo, via São Sebastião, Paraty and Angra dos Reis to Rio de Janeiro. As I was pretty late I was driving with my car (a VW Gol without steering wheel lock) from São Paulo directly to São Sebastião, leaving out Santos and returned my car after some days in Angra dos Reis, where I switched to a car shuttle.
The road is in good condition and you come across nice beaches; some close to the road, some where you have to drive some kms through undulating roads and the rainforest. In the first case, it is easy to get to the water; in the second case you’ll find secluded places. An interesting thing are the speed cameras along the way: All Brazilians are slowing down directly in front of the camera and then speeding up again afterwards. That is something you’ll have to train. 😉