Catalysis of the reaction: (S)-3-hydroxyacyl-CoA + NAD(P)+ = 3-oxoacyl-CoA + NAD(P)H + H+, where the acyl group is a very long-chain fatty acid residue. A very long-chain fatty acid has an aliphatic tail containing more than 22 carbons.
very-long-chain-3-hydroxyacyl-CoA dehydrogenase activity