It is an action movie. I remember the scene where the main character is standing in front of a building, an embassy, or something like that, then he thinks from where the other character he is looking for could shoot at that building. He has a vision that he will shoot from a train passing right in front of that building. That’s what happens, they fire a rocket at the building. It’s about the fast one, not the slow one on the rails. The train was at some height between the buildings. That main character has a vision of what will happen soon. At the beginning of the film, when they were shooting, he knew when another character would run out of bullets, then he shot and killed him because he had a vision in his head of when that would happen. After that, he probably enters the building where the drug addicts are. Throughout the film, he has a vision of what will happen in the next moment
It sounds like you’re describing the movie “Minority Report,” which features a main character named John Anderton who possesses precognitive abilities and can see glimpses of the future. In the movie, Anderton is a police officer working for a specialized unit called the “Precrime Division,” which uses the visions of three genetically engineered “precogs” to prevent crimes before they happen. At one point in the movie, Anderton has a vision of a man firing a rocket at a building from a train, and he is able to prevent the attack from occurring. Do you think this is the movie you’re thinking of?
Could it be the movie “Next (2007)”