Questions & Answers about Мы вышли из переполненного вагона и пошли домой пешком.
Because выйти / выходить specifically means to go out, to exit an enclosed space.
- вышли из вагона = we got out of the carriage / car
- ушли would mean went away / left, focusing less on exiting the inside of something and more on departing in general
So in this sentence, вышли is the natural verb because the people are leaving the inside of the вагон.
The preposition из requires the genitive because it means out of / from inside.
So:
- вагон = nominative
- из вагона = genitive, meaning out of the carriage
This is a very common pattern in Russian:
- из дома = out of the house
- из машины = out of the car
- из вагона = out of the carriage