This work presents a distributed in-line strategy to manage an isolated microgrid by optimizing active and reactive power dispatch. The proposed objective function leads to minimize the operation costs and addresses some technical requirements such as diminishing power losses and voltage deviation. Additionally, the strategy deals with temporal multi-scale goals, i.e., robustness to demand disturbances and variation of renewable resources (a short-term objective), and preservation of the health of battery-based storage systems (a long-term objective). The technique uses alternating directions method of multipliers (ADMM), accelerated consensus, and a novel battery degradation model (Quadratic AH-Throughput model). We test the proposed solution in a case study that includes renewable resources and lead-acid and lithium batteries. To obtain the results of the case study, we employ a co-simulation scheme that uses Matlab and DIgSILENT. Finally, the performance of the method is compared with a centralized optimization technique.