  Here, using density functional theory and density matrix renormalization
group methods, we investigate the electronic and magnetic properties of
RuOCl$_2$ and OsOCl$_2$ with $d^4$ electronic configurations. Different from a
previous study using VOI$_2$ with $d^1$ configuration, these systems with
$4d^4$ or $5d^4$ do not exhibit a ferroelectric instability along the $a$-axis.
Due to the fully-occupied $d_{xy}$ orbital in RuOCl$_2$ and OsOCl$_2$, the
Peierls instability distortion disappears along the $b$-axis, leading to an
undistorted I${\rm mmm}$ phase (No. 71). Furthermore, we observe strongly
anisotropic electronic and magnetic structures along the $a$-axis. The large
crystal-field splitting energy (between $d_{xz/yz}$ and $d_{xy}$ orbitals) and
large hopping between nearest-neighbor Ru and Os atoms suppresses the
spin-orbital effect in $M$OCl$_2$ ($M$ = Ru or Os) with electronic density $n =
4$, resulting in a spin-1 system instead of a $J = 0$ singlet ground state.
Moreover, we find staggered antiferromagnetic order with $\pi$ wavevector along
the $M$-O chain direction ($a$-axis) while the magnetic coupling along the
$b$-axis is weak. Based on Wannier functions from first-principles
calculations, we calculated the relevant hopping amplitudes and crystal-field
splitting energies of the $t_{2g}$ orbitals for the Os atoms to construct a
multi-orbital Hubbard model for the $M$-O chains. Staggered AFM with
$\uparrow$-$\downarrow$-$\uparrow$-$\downarrow$ spin structure dominates in our
DMRG calculations, in agreement with DFT calculations.
