Bridges play a critical role in transportation networks; however, they are vulnerable to deterioration, aging, and degradation, especially in the face of climate change and extreme weather events such as floodings. Furthermore, bridges can significantly affect social vulnerability; their damage or destruction can isolate communities, inhibit emergency responses, and disrupt essential services. Maintaining critical bridges in a cost-effective and sustainable manner is crucial to ensure their longevity and protect vulnerable communities. To address the maintenance optimization problem of bridge systems considering the effects of time deterioration, flood degradation, and social vulnerability, this study proposes a deep reinforcement learning algorithm to optimally allocate resources to bridges that are at expected cost of failure due to scour. The algorithm considers the effects of flood degradation with different return periods and is trained using a Markov Decision Process as the environment. The study conducts four flood simulation scenarios using Geographic Information System data. The findings suggest that the deep reinforcement learning algorithm proposes a sequence of repair actions that outperforms the status quo, currently employed by bridge managers. The significance of this study lies in its valuable insights for cities worldwide on how to effectively optimize their limited resources for the maintenance and rehabilitation of critical infrastructure systems to decrease portfolio cost and increase social equity.