I do not know that there is any way to answer this question for sure. I tend to believe, however, that the ghosts (at least in the story) are actually real.
The main reason that I think the ghosts are "real" is that it is not only the signal man who sees them. He is the one who sees most of them but, at the end of the story, the narrator sees one of them as well. This implies that they must be real.
The other thing that makes me say they are real is that they appear to predict bad things that are going to happen. It does not seem likely that the signal man could imagine such things in advance of the bad things actually happening.
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 and so the answer to your question would be, if you believe in the supernatural and if you believe that there are ghosts, then yes this story is a 'ghost story' and the ghost is a real ghost, otherwise its only a figment of the reader's imagination.
If u read the end of the story u will see "the nameless horror that opressed me passed in a moment, for in a moment i saw that this appearence of a man was a man indeed" so even the narrator realizes that he saw no ghost. Only the signalman saw these ghosts.
^Yes, like stated above, it depends on your own understanding. There are two sides to the story; logical and illogical, and you can believe whichever one you choose to.