Question
I was developing the following ideas for a gas and was wondering if these ideas were already in the literature?
The main ideas are:

Using the action in thermodynamics
 Including the collision
 Using the mean free path to define temperature
I'm not sure how one would derive the intended formula at the end.
Background
Usually, the Hamiltonian of a gas at thermal equilibrium does not include a collision term which would imply at a collision:
$$ \underbrace{\cdot}_{A} \rightarrow \leftarrow \underbrace{\cdot}_{B}$$
$$ \underbrace{\cdot}_{B} \leftarrow \rightarrow \underbrace{\cdot}_{A}$$
They actually go through each other.
My attempt
Consider a relativistic gas (point) particles with a $2$ particles $A$ and $B$ in a box and the only collide once.
The line element of the $A$and $B$ before a collision is given by $ds_i^2 $
where $i=A$ or $i=B$. Similarly, the action is given by:
$$ S_i =  m_ic \int_P d s_i$$
Where $P$ is the world line before the collision $s_A^\mu = s_B^\mu$ where $s_i^\mu$ is the four position vector. After the collision, we know the momentum $p^\mu$ is conserved:
$$ p_A^\mu + p_B^\mu = {p'}_A^\mu + {p'}_B^\mu$$
where ${p'}_i^\mu$ denotes the momentum after the collision. Differentiating with respect to $\frac{d}{ds_i}$ and using
$ \frac{d p^\mu_i}{ds_i} =0$ then:
$$ \frac{d p_j^\mu}{ds_i} = \frac{d {p'}_A^\mu}{ds_i} + \frac{d {p'}_B^\mu}{ds_i}$$
with $j \neq i$
After the collision the action is given by:
$$ S'_i =  m_i c \int_{P'} d s'_i$$
where $P'$ is the world line after the collision and $d s'_i$ is defined by $\frac{dp'_i}{ds'_i} = 0$.
Let us write $ds_A$ in terms of $ds'_A$. We proceed with:
$$ \frac{d {p}_A^\mu}{ds_i} + \frac{d {p}_B^\mu}{ds_i} = \frac{d {p'}_j^\mu}{ds_i}$$
Using the chain rule:
$$ \frac{d {p}_A^\mu}{ds_i} + \frac{d {p}_B^\mu}{ds_i} = \frac{d {p'}_j^\mu}{ds'_j} \frac{d s'_j}{ds_i} = \frac{\frac{d {p'}_j^\mu}{ds'_j}}{(\frac{d s'_j}{ds_i})^{1}}$$
And as the L.H.S above is finite:
$$\frac{d {p'}_j^\mu}{ds'_j} \to 0 \implies (\frac{d s'_j}{ds_i})^{1} \to 0$$
Using L' Hopital Rule:
$$ \frac{d {p'}_j^\mu}{ds_i} =\frac{d {p}_A^\mu}{ds_i} + \frac{d {p}_B^\mu}{ds_i} = \frac{\frac{d^2 {p'}_j^\mu}{{ds'_j}^2}}{\frac{d}{ds'_j}(\frac{d s'_j}{ds_i})^{1}}$$
Or:
$$\frac{d}{ds'_j}(\frac{d s'_j}{ds_i})^{1} \frac{d {p'}_j^\mu}{ds_i} = \frac{d^2 {p'}_j^\mu}{{ds'_j}^2}$$
The above should be solvable as we have $2$ boundary conditions (conservation of momentum and $s_i = s_j$). Hence:
$$ {ds_i} = {d s'_j} \int \frac{d^2 {p'}_j^\mu}{{ds'_j}^2} (\frac{d {p'}_j^\mu}{ds_i})^{1} {ds'_j}$$
Hence, the action of particle $i$ is:
$$ S_i =  m_ic \int_P {d s'_j} \Big ( \int \frac{d^2 {p'}_j^\mu}{{ds'_j}^2} (\frac{d {p'}_j^\mu}{ds_i})^{1} {ds'_j} \Big)  m_i c \int_{P'} d s'_i$$
One can take sum over $i$ to find the net action.
General case and more work
Now, there are an infinite number of collisions for $N$ particles and the is temperature $T_1$. We know the mean free path is a function of temperature. Hence,
$$ S'_i =  m_ic \int_P d s_i  m_i c \int_{P'} d s'_i  \dots $$
$$ T = f(\text{Most Probable}(\text{Length}(P'' ^k))$$
Where $\text{Length}(P)$ is the length of an arbitrary worldline $P'' ^k$, $\text{Most Probable}$ tells one the most probable function in the series of the action $S_i$ and $f$ is an unknown function.