To synthetically target a specific material with select performance, the underlying relationship between structure and function must be understood. For targeting magnetic properties, such understanding is underdeveloped for a relatively new class of layered hexagonal perovskites, the 12R-Ba4MMn3O12 family. Here, we perform a detailed magnetostructural study of the layered hexagonal perovskite materials 12R-Ba4MMn3O12, where M = diamagnetic Ce4+ or paramagnetic Jeff ≈ 1/2 Pr4+. The material with M = Ce4+ is an antiferromagnet below TN ≈ 7.75 K, while the material with M = Pr4+ exhibits more complex behavior, with a net moment below 200 K and a sharp peak in the susceptibility at TN ≈ 12.15 K. Guided by the susceptibility data, we conduct variable-temperature powder neutron diffraction measurements to determine the magnetic structure of these two materials. The introduction of a magnetic interlayer cation cants the spins in the Mn3O12 trimers out of plane. We further characterize the crystal and electronic structures in these compounds using powder X-ray diffraction and X-ray absorption spectroscopy measurements coupled with first-principles theoretical calculations. The resulting detailed picture of the magnetic, crystal, and electronic structure will be useful for understanding the magnetism in similar 12R hexagonal perovskites and related materials.