To me, the major theme of this story is that human beings care about each other but are totally helpless in the face of our fate and/or powers that are greater than we are.
In this story, the apparitions keep appearing to warn that tragedies are going to happen in connection with the trains. But no matter how much warning they give, the people can't prevent the accidents.
The apparitions symbolize people's desire to help one another. But their inability to actually help is meant to illustrate that we are really powerless -- that our fate and powers bigger than us will determine what happens to us in the end.
The main theme of this enigmatic short story is the contrast between the 'real world' and the 'unreal world.' The theme would be that "truth is stranger than fiction."
The lonely but very vigilant and conscientious signal man is deeply troubled by the coincidental connections between the different accidents but he is convinced that no one would believe him. He feels guilty that he has not been able to warn the victims in time because if he had tried to the authorities would not have believed him and they would have dismissed him from his job. The narrator of the story comforts and consoles him and promises to take him to a doctor to cure him of his troubled and anxious state:
Therefore, setting aside all question of reality or unreality between us, I represented to him that whoever thoroughly discharged his duty must do well, and that at least it was his comfort that he understood his duty, though he did not understand these confounding Appearances.
When the engine driver demonstrates exactly how the accident occurred the narrator "started" because he realized that his actions exactly resembled those of an apparition he himself had seen just as he was coming down to meet the signal man and take him to the doctor.
Life has its share of mysteries and 'truth is often stranger than fiction.'