Hollywood in general has been obsessed with trains in action scenes since pretty much its inception. Let's not forget that one of, if not THE first films shown in a cinema was a clip of a train coming towards the camera. The inexperienced crowd in the cinema screamed and panicked at the thought that it may actually come straight out of the screen.
Trains are a great option for superhero action for several reasons, mostly tied to the fact that they're fast:
-They set a fast pace, meaning that any action that happens around them is going to feel fast and chaotic regardless of quality.
-They're dangerous, which only adds to the overall danger of an action sequence.
-They cover large distances. Another useful aspect of trains in films is that while the fighting is taking place, we're also heading to new places. If you want your character to cross the country, but not just have dead space, then a fight sequence on a train fulfils both these roles perfectly.
-They've got compartments and hide spaces. A good action scene on a train generally highlights their modular capacities and unique carriage style. Best example: Spider-Man 2
-They play to the strengths of the characters. Regardless of ability, almost any comic character has something they can do on a train that is going to make the action exciting to watch. Spider-Man and Doc Ock roling around it using their different powers, Quicksilver jolting around to save the passengers, Magneto ripping it apart, Wolverine ripping it apart a different way. You get the idea.
-They're scary. A lot of people are uncomfortable around trains subconsciously, because they play to a lot of baked in fears. They're fast and loud, they're cramped and potentially even claustrophobic, and they're full of strangers. That's a lot you can play with subconsciously when setting up the action sequence.
-They're mundane. Set against the fear and action of the fight, the fact that everyone uses trains as a part of their lives is a great juxtaposition. Showing normal people doing normal things, while superheroes are battling above them, can be funny, scary, or just highlighting of how exciting they are.
-They have built-in collateral. Once again using Spider-Man 2 as an example, a villain doesn't need to actually win a fight on a train to win, because if the hero lets a train full of innocent people die then they've lost. Passengers create a perfect audience surrogate for us to worry about. "Save the passengers Spider-Man! I use trains: that could be me!" Seeing the hero defeat the villain or just save the passengers is a huge thing for us that a lot of the audience won't even consciously notice.
-Similarly, they have built-in distraction. The passengers can also be used to distract the hero. Doc Ock pulling passengers out and throwing them from the train makes Spider-Man focus on them rather than the villain, but something as simple as a character ducking behind an innocent person, or attempting to shoot through the crowd, gives the hero yet another thing to worry about.
-They're surrounded with additional dangers. The biggest cliché of a train scene is dodging signs or ducking for a tunnel. This is overplayed but it's still effective because we can keep pace with the action but also be surprised by it. Obstacles can also set a pace for the heroes, which gives an additional timer to the action. An example of this would be Skyfalls opening train fight. The threat of the upcoming tunnel lends the scene a countdown timer that makes everything more tense.
-They have limitless exits. A train fight has the unique option of being able to end in any way, and still allow the film to continue. You can capture the hero or villain, you can defeat them. You can end in a tie, or a forced tie with one of them fleeing, like Doc Ock (I will not apologise for continually using the best ever action sequence in superhero films as examples) or a technical tie with both sides falling from the train. People can be killed, people can APPEAR to be killed. People can appear defeated and then return later. A villain can appear defeated and then give us one last threat as they get back up and take a hostage. There are limitless options on a train, especially with the fact that someone with powers can exit in any direction.
So yeah, that's basically why superhero action sequences love trains. Seeing more variety, such as Shang-Chi's fantastic bus sequence, would be awesome, but trains won't be going anywhere soon because they're so useful.