Involved in the metabolism of galactose. Catalyzes the conversion of UDP-galactose (UDP-Gal) to UDP-glucose (UDP-Glc) through a mechanism involving the transient reduction of NAD. It is only active on UDP-galactose and UDP-glucose. UDP-alpha-D-glucose = UDP-alpha-D-galactose Inhibited by UDP-phenol and NaBH3CN. kcat is 760 sec(-1) for UDP-Glc (at pH 8.5 and 27 degrees Celsius) and 24 sec(-1) for UDP-Gal (at pH 8.5). Carbohydrate metabolism; galactose metabolism. Homodimer. By D-galactose and D-fucose. Belongs to the NAD(P)-dependent epimerase/dehydratase family.