Electric motors are heavy, but they have better energy efficiency than muscles.
The reason why muscles do not overheat as much as electric motors, despite lower efficiency, is because they have good liquid cooling, by blood. The cooling system of animals has outstanding reliability, due to self repair. Liquid cooling is also possible for electric motors, but it is usually avoided due to high cost and low reliability.
The weight problem of the electric motors is solved by keeping them in the body of the robot and transmitting the movement towards the moving parts that need low inertia by various means (ropes, cables, levers, hydraulic/pneumatic fluids).
This is also done with muscles, which frequently are far away from the bone that they are moving and the movement is transmitted by long thin tendons, to reduce the inertia of the moving limb.