Zero-Touch Deterministic Industrial Machine-to-Machine (ZT-DI-M2M) serves as a customized communication solution designed to meet the specific needs of industrial settings. Though 5G is the promising solution for ZT-DI-M2M, optimized scheduling in 5G remains challenging to design over aspects such as network overload and congestion control, especially in the uplink transmission of ZT-DI-M2M. Effective allocation of resources for Machine-Type Communication (MTC) devices stands out as a pivotal hurdle within the domain of 5G networks. This challenge directly influences the longevity of batteryoperated devices and the Quality of Service (QoS) experienced by applications. This paper aims to develop a Group-Based and Energy Aware (GBEA) resource allocation algorithm for M2M communication in the 5G networks. The GBEA algorithm solves the resource allocation problem by initially clustering the active nodes concerning their delays. Consequently, inter and intra-cluster resource distribution occurs through the Gaussian Mixture Model Expectation Maximization (GMM-EM) algorithm. The GBEA algorithm optimizes the resource allocation of M2M devices by factoring delay, energy, proximity, and fairness into the allocation process. The simulation outcomes unveil the superiority of the GBEA scheduling algorithm over established state-of-the-art resource allocation methods. It showcases remarkable enhancements in terms of throughput, delay sensitivity, and energy efficiency, boasting nearly 1.5-fold, 1.75-fold, and 6.5-fold respective improvements.