Catalyzes the NADPH-dependent reduction of trans-2-enoyl thioesters in mitochondrial fatty acid synthesis (fatty acid synthesis type II). Fatty acid chain elongation in mitochondria uses acyl carrier protein (ACP) as an acyl group carrier, but the enzyme accepts both ACP and CoA thioesters as substrates in vitro. Displays a preference for medium-chain over short- and long-chain substrates (PubMed:12654921, PubMed:18479707, PubMed:27817865). May provide the octanoyl chain used for lipoic acid biosynthesis, regulating protein lipoylation and mitochondrial respiratory activity particularly in Purkinje cells (By similarity).