The COVID-19 pandemic accelerated the shift towards online shopping, reshaping consumer habits and intensifying the impact on urban freight distribution. This disruption exacerbated traffic congestion and parking shortages in cities, underscoring the need for sustainable distribution models. The European Union's common transport policy advocates for innovative UFD approaches that promote intermodal transportation, reduce traffic, and optimize cargo loads. Our study addresses these challenges by proposing an agile routing algorithm for an alternative UFD model in Barcelona. This model suggests strategically located micro-hubs selected from a set of railway facilities, markets, shopping centers, district buildings, pickup points, post offices, and parking lots (1057 points in total). It also promotes intermodality through cargo bikes and electric vans. The study has two main objectives: (i) to identify a network of intermodal micro-hubs for the efficient delivery of parcels in Barcelona and (ii) to develop an agile routing algorithm to optimize their location. The algorithm generates adaptive distribution plans considering micro-hub operating costs and vehicle routing costs, and using heuristic and machine learning methods enhanced by parallelization techniques. It swiftly produces high-quality routing plans based on transportation infrastructure, transportation modes, and delivery locations. The algorithm adapts dynamically and employs multi-objective techniques to establish the Pareto frontier for each plan. Real-world testing in Barcelona, using actual data has shown promising results, providing potential scenarios to reduce CO2 emissions and improve delivery times. As such, this research offers an innovative and sustainable approach to UFD, that will contribute significantly to a greener future for cities.