High energy efficiency is a key requirement for modern construction machinery. This is because of stricter environmental targets, electrification, and reduction of operation costs. To meet this requirement, the powertrain architectures of the machines are becoming increasingly complex, for example through hybridisation of drivetrain and work functions, or with improved hydraulic systems. However, the more complex the architecture is, the harder the management of splitting power between different sources and consumers. The number of work functions, operating environments, and tasks these machines engage in, along with the added degrees of freedom with respect to how energy can be recovered, exchanged, and reused, makes them unique. Therefore, the development of control strategies for energy management in such machines requires specific research and development with their architecture and application in focus. This doctoral thesis presents an analysis of two methods for the development of machine learning-based energy management strategies for construction machines. One is based on supervised learning and the other on reinforcement learning. The methods use optimisation to find optimised solutions for the control problem of the systems and machine learning for learning and implementing the control decisions. In both methods, models of the physical systems are used for the learning and training. The thesis highlights and confirms, with experimental results, the potential of such methods to derive control strategies for these machines. The studied methods can learn and implement improved control decisions in the real systems that result in the potential for increased efficiency. At the same time, their robustness is shown in the application to unseen scenarios during training, although that does not eliminate the need for further training in the real systems after deployment. The thesis also increases the comprehensiveness on energy management for construction machines. The thesis was completed in a double-degree format between the