The energy not lost to friction is being loaded into the system as the gears and axles start to strain from the stresses applied. Some energy is potential energy like a compressed spring. The balance is spent making the material yield; this will be lost as heat.