Structure and phase transitions in A-site ordered RBaMn2O6 (R = Pr, Nd) perovskites with a polar ground state