The 12L hexagonal perovskite Ba4BiIr3O12 has been synthesized for the first time and characterized using high-resolution neutron and synchrotron X-ray diffraction as well as physical properties measurements. The structure contains Ir3O12 linear face-sharing octahedral trimer units, bridged by corner-sharing BiO6 octahedra. The average electronic configurations of Ir and Bi are shown to be +4(d5) and +4(s1), respectively, the same as for the S = 1/2 dimer system Ba3BiIr2O9, which undergoes a spin-gap opening with a strong magnetoelastic effect at T* = 74 K. Anomalies in magnetic susceptibility, heat capacity, electrical resistivity, and unit cell parameters indeed reveal an analogous effect at T* ≈ 215 K in Ba4BiIr3O12. However, the transition is not accompanied by the opening of a gap in spin excitation spectrum, because antiferromagnetic coupling among S = 1/2 Ir4+ (d5) cations leads to the formation of a S = 1/2 doublet within the trimers, vs S = 0 singlets within dimers. The change in magnetic state of the trimers at T* leads to a structural distortion, the energy of which is overcompensated for by the formation of S = 1/2 doublets. Extending this insight to the dimer system Ba3BiIr2O9 sheds new light on the more pronounced low-temperature anomalies observed for that compound.