The distribution of trace metals (TMs) in a continuous water body often exhibits watershed attributes, but the tidal gates of the coastal rivers may alter their transformation and accumulation patterns. Therefore, a tidal gate-controlled coastal river was selected to test the distribution and accumulation risks of Al, As, Cr, Cu, Fe, Mn, Ni, Sr, and Zn in the catchment area (CA), estuarine area (EA), and offshore area (OA). Associations between TMs and bacterial communities were analyzed to assess the feasibility of using bacterial parameters as ecological indicators. The results showed that As and Cr were the key pollutants due to the higher enrichment factor and geoaccumulation index, reaching slight to moderate pollution levels. The Nemero index was highest in EAs (14.93), indicating a higher pollution risk in sediments near tide gates. Although the TM dynamics can be explained by the metal-indicating effects of Fe and Mn, they have no linear relationships with toxic metals. Interestingly, the metabolic abundance of bacterial communities showed good correlations with different TMs in the sediment. These results highlight bacterial community characteristics as effective biomarkers for assessing TM pollution and practical tools for managing pollution control in coastal environment.