You're right. I think there was a mistake on the examination. That "for" shouldn't be there.
By a few hours can mean the same thing as for a few hours. The only difference to my mind is that By a Few Hours gives the impression that the departure had been delayed, but the train in now on the way, and For a Few Hours gives more the impression that the train might still be waiting to depart. However, I think they can be used interchangeably.