Any answer seems necessarily based on speculation, as it's not something that has enough precedent to have any meaningful answer. Even if you find a case here or there that "settled" the matter, said case isn't particularly likely to hold up in a new court setting.
However, I would argue the answer is yes, based on two points.
First, the fact that the graffiti artist has implicitly given the design to the train company.
If I broke into your house and left plans to build a new kind of train, it seems unlikely anyone would dispute that I had given you both the plans and the right to use them (presuming I held the copyright to begin with).
Aesthetic art is different from engineering plans, but I think the argument can still be made. Also, graffiti is necessarily a one-off design, so you can't really argue that the graffiti artist is losing anything in the process.
Second, that the train company is losing money by having to clean or re-paint the train car as a result of the vandalism. So it's perfectly fair for them to attempt to recoup some of that money by selling the art in question.
This isn't "fair use" in the standard, technical sense of established copyright law. But it's still a fair use.
Realistically, any lawsuit against a train company for illicit gains through any copyright infringement would pale in comparison to the counter lawsuit by the train company for repairs due to vandalism. So it seems that a good attorney could simply agree that the train company owes the artist a few dollars for the copyright infringement, which will be deducted from the thousands of dollars the artist owes for new paint.
At the end of the day, it's unfair to the train company to make them pay for both lawsuits, and the copyright claim, and the vandalism, but that's what would happen if the lawsuit continued. By pointing out that this is the reasonable result of any set of lawsuits, the train company's attorney might well get the entire thing thrown out nearly immediately.
Also, there's probably a large disparity in attorney fees. The train company will have spent tens of thousands on their attorneys (which the graffiti artist would have to compensate for in the vandalism claim), while the artist likely hired someone for a few thousand dollars, if they hired anyone at all (which the train company would have to compensate for in the copyright claim). This makes the net total the artist should pay even larger, further increasing the validity of a dismissal.