Smart cities are powered by several new technologies to enhance connectivity between devices and develop a network of connected objects which can lead to many smart industrial applications. This network known as the Industrial Internet of Things (IIoT) consists of sensor nodes that have limited computing capacity and are sometimes not able to execute intricate industrial tasks within their stipulated time frame. For faster execution, these tasks are offloaded to nearby fog nodes. Internet access and the diverse nature of network types make IIoT nodes vulnerable and are under serious malicious attacks. Malicious attacks can cause anomalies in the IIoT network by overloading complex tasks, which can compromise the fog processing capabilities. This results in an increased delay of task computation for trustworthy nodes. To improve the task execution capability of the fog computing node, it is important to avoid complex offloaded tasks due to malicious attacks. However, even after avoiding the malicious tasks, if the offloaded tasks are too complex for the fog node to execute, then the fog nodes may struggle to process all legitimate tasks within their stipulated time frame. To address these challenges, the Trust-based Efficient Execution of Offloaded IIoT Trusted tasks (EEOIT) is proposed for fog nodes. EEOIT proposes a mechanism to detect malicious nodes as well as manage the allocation of computing resources so that IIoT tasks can be completed in the specified time frame. Simulation results demonstrate that EEOIT outperforms other techniques in the literature in an IIoT setting with different task densities. Another significant feature of the proposed EEOIT technique is that it enhances the computation of trustable tasks in the network. The results show that EEOIT entertains more legitimate nodes in executing their offloaded tasks with more executed data, with reduced time and with increased mean trust values as compared to other schemes.