Spin-orbit coupling controlled ground states in the double perovskite iridates A2BIrO6 (A = Ba, Sr; B = Lu, Sc)