Catalyzes the 2-epimerization of trans-4-hydroxy-L-proline betaine (tHyp-B) to cis-4-hydroxy-D-proline betaine (cHyp-B). Is involved in a catabolic pathway that degrades tHyp-B to alpha-ketoglutarate. This pathway would permit the utilization of tHyp-B as a carbon and nitrogen source in the absence of osmotic stress, since tHyp-B functions as an osmolyte and is not catabolized when it is needed as osmoprotectant. Can also catalyze the racemization of L-proline betaine. trans-4-hydroxy-L-proline betaine = cis-4-hydroxy-D-proline betaine L-proline betaine = D-proline betaine Binds 1 Mg(2+) ion per subunit. kcat is 110 sec(-1) with trans-4-hydroxy-L-proline betaine as substrate (PubMed:24056934). kcat is 68 sec(-1) with L-proline betaine as substrate (PubMed:24056934). kcat is 28 sec(-1) with D-proline betaine as substrate (PubMed:24520058). Up-regulated by tHyp-B and cHyp-B. Repressed by high salt concentration. Cells lacking this gene grow more slowly than wild-type on tHyp-B as sole carbon source, whereas growth is normal on cHyp-B. When both hpbD and hypF are disrupted, P.denitrificans is unable to utilize tHyp-B or tHyp as sole carbon source. Belongs to the mandelate racemase/muconate lactonizing enzyme family.