The increasing complexity of economic systems has made it advisable to make managerial decisions based on optimization problems. A two-level megaproject management system is considered. The upper level is represented by the optimization network model of the megaproject, the lower level is represented by optimization network models of projects subsystems included in it. The purpose of the article is to propose a method for finding the optimal distribution of resources between subsystems with minimal costs for the implementation of a megaproject, taking into account resource constraints and target time frames. The method is based on the principle of comparing Lagrange multipliers as indicators of the value of resources for subsystems. Optimal search is presented as an iterative process. Similar approach has not previously been considered. The article describes an algorithm and its implementation on a real example of a megaproject of the East Siberian Oil and Gas Complex for the case of two subsystems. The results showed the efficiency of the algorithm.