The following solves quickly with at least one commercial solver. Let binary decision variable $x_{ij}$ indicate whether person $i$ rides in car $j$. The constraints are:
\begin{align}
\sum_j x_{ij} &= 1 &&\text{for all $i$} \tag1\label1 \\
\sum_{k\not= i} x_{kj} + (m - 1 - M_i) x_{ij} &\le m - 1 &&\text{for all $i$ and $j$} \tag2\label2
\end{align}
Constraint \eqref{1} assigns each person to exactly one car.
Constraint \eqref{2} enforces the logical implication $$x_{ij} = 1 \implies \sum_{k\not= i} x_{kj} \le M_i,$$
which you could instead enforce via an indicator constraint.
An interesting variant would be to minimize the number of cars used. In that case, introduce a binary variable $y_j$ to indicate whether car $j$ is used, change the RHS of \eqref{2} to $(m-1)y_j$, and minimize $\sum_j y_j$.
This formulation lends itself to column generation with a set partitioning master problem, and Ryan-Foster branching can perform well. That approach is automated in SAS if you specify to use the Dantzig-Wolfe decomposition algorithm with METHOD=SET or explicitly identify the block structure via the .BLOCK constraint suffix. If you are using a different solver, you can try implementing column generation yourself. The corresponding formulation has a binary decision variable $z_S$ for each feasible subset $S$ of (at most $4$) people. The constraints are then:
\begin{align}
\sum_{S: i \in S} z_S &= 1 && \text{for all $i$} \tag3\label3 \\
\sum_{S} z_S &\le n \tag4\label4
\end{align}
Constraint \eqref{3} assigns each person to exactly one car.
Constraint \eqref{4} enforces using at most $n$ cars.
For static column generation, you would generate all feasible $S$ a priori and solve one MILP. For dynamic column generation, you would need to iterate between a master LP problem and a MILP subproblem.