Catalysis of the reaction: 5-methyltetrahydrofolate + NAD(P)+ = 5,10-methylenetetrahydrofolate + NAD(P)H + H+.
methylenetetrahydrofolate (reduced nicotinamide adenine dinucleotide phosphate) reductase activity