Understanding how environmental factors affect population dynamics is crucial for conservation. In this study, we examine the importance of habitat and climate factors on juvenile productivity, adult mortality, and demographic performance (DP) of Formicivora acutirostris in a floristic gradient (upstream and downstream) in the Guaratuba Bay estuary, Brazil. We monitored 14–41 territories during 18 years, which totaled 214 adult territorial individuals and 297 independent juveniles. Data imputation, generalized linear mixed models, and random forest models were used in the analysis. The average annual juvenile productivity per territory was 0.64 upstream and 0.56 downstream. Juvenile productivity upstream was positively associated with the number of neighbors, Cladietum area, and vegetation density in Crinetum, and showed a quadratic relationship with Acrostichetum density. Downstream, productivity increased with precipitation and rainy days but decreased with maximum temperature; and was higher in areas with forks in Acrostichetum. Adult mortality averaged 0.32 upstream and 0.25 downstream. Upstream, mortality decreased with maximal tidal height, increased with the number of rainy days, and showed a quadratic relationship with vegetation density in Crinetum. The overall DP upstream was 0, and downstream was 1.5. DP was positively influenced by Cladietum area upstream and by the presence of forks in Acrostichetum downstream. The study highlights Cladietum’s critical role in productivity, offering safe nesting sites. Acrostichetum, beneficial when forks are present, also provides predator refuge, impacting productivity. Crinetum contributes minimally due to predation and flooding. Climatic and tidal factors further influence vulnerability. We discuss population dynamics and the importance of conservation prioritization.