Catalyzes the dehydrogenation of (R)-2-hydroxyglutarate (D-2-hydroxyglutarate) to 2-oxoglutarate. Has also a low activity on D-malate in vitro (PubMed:34555022). Is functionally tied to L-serine biosynthesis, via its coupling with the D-3-phosphoglycerate dehydrogenase SerA, encoded by the adjacent gene in the locus (By similarity). Active in vitro with the artificial electron acceptor 2,6-dichlorophenolindophenol (DCPIP), but not with NAD, NADP, or cytochrome c. Also displays a very low oxidase activity in vitro on D-2-hydroxyglutarate and L-2-hydroxyglutarate with O2 as the electron acceptor, but this activity is most likely not physiological (PubMed:34555022). (R)-2-hydroxyglutarate + A = 2-oxoglutarate + AH2 (R)-malate + A = AH2 + oxaloacetate Binds 1 FAD per subunit. Activated by Zn(2+) ions. kcat is 5.9 sec(-1) with D-2-hydroxyglutarate as substrate and DCPIP as electron acceptor (at pH 7.4 and 25 degrees Celsius). kcat is 0.04 sec(-1) with D-malate as substrate and DCPIP as electron acceptor (at pH 7.4 and 25 degrees Celsius). Homodimer. Belongs to the FAD-binding oxidoreductase/transferase type 4 family.