I was doing a question about if a train fits in a tunnel.
Did the question assignment include a specific consistent definition of what's meant there by "to fit", in the first place?
Presumably, in the setup which is typically considered,
the ends of the tunnel (say participants $A$ and $B$) are supposed to be at rest to each other,
the ends of the train (say participants $J$ and $K$) are supposed to be at rest to each other,
the (ends of the) tunnel and the (ends of the) train are supposed to move at some particular non-zero speed $\beta := \frac{|\mathbf{ \vec v }|}{c}$ with respect to each other, such that
- $A$ first met and passed $J$, then met and passed $K$,
- $B$ first met and passed $J$, then met and passed $K$,
- $J$ first met and passed $A$, then met and passed $B$, and
- $K$ first met and passed $A$, then met and passed $B$.
It is then said that "the train fit in the tunnel" if:
$B$'s indication of being passed by $J$ was before $B$'s indication simultaneous to $A$'s indication of being passed by $K$,
and likewise (consistently) if:
$A$'s indication of being passed by $K$ was after $A$'s indication simultaneous to $B$'s indication of being passed by $J$.
Moreover, it can similarly be defined whether "the tunnel fit in the train"; namely if:
$K$'s indication of being passed by $A$ was before $K$'s indication simultaneous to $J$'s indication of being passed by $B$,
and likewise (consistently) if:
$J$'s indication of being passed by $B$ was after $J$'s indication simultaneous to $K$'s indication of being passed by $A$.
Finally, of particular interest are cases in which the ratio $R$ between the distance between the tunnel ends and the distance between the train ends satisfies
$$\sqrt{1 - \beta^2} \lt R \lt \frac{1}{\sqrt{1 - \beta^2}},$$
because in those cases,
related to the definition, within the theory of relativity, of (how to determine) "simultaneity", and
related to the definition, within the theory of relativity, of (how to determine) ratios of "distances", and
related to the definition, within the theory of relativity, of (how to determine) "mutual rest", and
related to the definition, within the theory of relativity, of (how to determine) "mutual speed", and
related to the definition of (how to determine) "fit" as described above (also based on the terminology and available definitions within the theory of relativity),
it follows that
"the train fit in the tunnel" and "the tunnel fit in the train".
From the train frame it does not and from the tunnel frame it does.
That's a very brief, superficial, arguably improper and seemingly paradoxial way of stating what I laid out in some detail above.
Then the question asked are these two answers consistent?
They are consistent based on the detailed definitions and setup description mentioned above.
Please [...] if possible give a source
At least there is a one well-known source for the definition, within the theory of relativity, of (how to determine) "simultaneity", namely
A. Einstein, Relativity: The Special and General Theory., chap. 8: On the Idea of Time in Physics.
The other relevant definitions are unfortunately only less widely documented.
Some related presentations on PSE on how to use these definition are Deriving formula for time dilation
and What is the real meaning of length contraction? .