You can squeeze side-by-side, but you cannot share a space while doing so except briefly during your turns
So, you can never end movement in an illegal space. If you do, you are shunted to the closest legal space with a preference for your last occupied legal space:
Accidentally Ending Movement in an Illegal Space: Sometimes a character ends its movement while moving through a space where it's not allowed to stop. When that happens, put your miniature in the last legal position you occupied, or the closest legal position, if there's a legal position that's closer.
However, this is not particularly an issue in the scenario which you describe, since squeezing changes the space you occupy:
When a Large creature (which normally takes up 4 squares) squeezes into a space that’s 1 square wide, the creature’s miniature figure occupies 2 squares, centered on the line between the 2 squares. For a bigger creature, center the creature likewise in the area it squeezes into.
In this way, a large creature standing adjacent to another large creature in the proposed hallway requires at least one of them to be squeezing, and you could fit three such creatures if they all squeezed.
There's no indication that squeezing has to end after movement ("You can squeeze through or into a space", etc, emphasis added) or after your turn, so there's no reason to rule that way, especially since it has very wonky side effects that can be neatly avoided by using a prima facie reading of the rules.
Note that, however, there is almost no reason for two large creatures to ever do what you describe. It is almost always better to have the two of them staggered one after another so that they nonetheless block the hallway but aren't squeezing than to have one of them take a -4 penalty to hit and AC. There are tactical exceptions in some situations when neither of them has ranged attacks or spells or reach weapons, and there could be situations where the hallway they wanted to stand guard in was only 10-15' long, but squeezing is a pretty big penalty to take one when you don't have to.