In this paper, we propose an agent-based hierarchical power management model in a power distribution system composed of several microgrids (MGs). At the lower level of the model, multiple MGs bargain with each other to cooperatively obtain a fair, and Pareto-optimal solution to their power management problem, employing the concept of Nash bargaining solution and using a distributed optimization framework. At the highest level of the model, a distribution system power supplier, e.g., a utility company, interacts with both the cluster of the MGs and the wholesale market. The goal of the utility company is to facilitate power exchange between the regional distribution network consisting of multiple MGs and the wholesale market to achieve its own private goals. The power exchange is controlled through dynamic energy pricing at the distribution level, at the day-ahead and real-time stages. To implement energy pricing at the utility company level, an iterative machine learning mechanism is employed, where the utility company develops a price-sensitivity model of the aggregate response of the MGs to the retail price signal through a learning process. This learned model is then used to perform optimal energy pricing. To verify its applicability, the proposed decision model is tested on a system with multiple MGs, with each MG having different load/generation data.