The tetragonal intermetallic compounds U2Ni2In and U2Rh2Sn have been studied by means of specific-heat, electrical-resistivity, and neutron-diffraction techniques. At low temperatures, both compounds order antiferromagnetically in a magnetic unit cell doubled along the c axis, and we find 5f moments of 0.60 and 0.38 Bohr magneton/U atom for U2Ni2In and U2Rh2Sn, respectively. For U2Ni2In, our refinement also indicates a possible Ni moment of 0.37 Bohr magneton perpendicular to the U moments. We discuss the development of the 5f moments together with findings on other isostructural U2T2X (T=transition metal, X=In, Sn) compounds, and confirm that the trends expected due to 5f-ligand hybridization also hold for this family of uranium compounds. Our analysis indicates different arrangements of the 5f moments in the two compounds (noncollinear arrangement within the basal plane for U2Ni2In and collinear arrangement along the c axis for U2Rh2Sn), although both compounds have nearest-neighbor U-U distances along the c axis. This would mean that the magnetocrystalline anisotropy in U2T2X compounds is not determined by nearest-neighbor U-U links alone