Copyright and trademark law does give the holder the rights to protect the integrity of their marks and how the marks are used in commerce.
That's the whole idea behind those laws.
I'm aware (I teach intellectual property law for a living ). But trademark law does not give the owner the right to control all uses of the mark, even without the First Amendment limitations that rplst8 mentioned.
Trademark infringement requires that consumers would think that UP is the source of the models, or at least that UP endorsed or sponsored them. If you think that is likely when a train manufacturer produces a model in a railroad's livery, then that's your call on the facts.
Trademark dilution requires that the use lessen the ability of mark to identify the goods or services of the mark holder, or bring the mark into disrepute. Given that there are hundreds, if not thousands of graffitied engines in the real world, I think it's a very hard sell that producing a model of one would blur or tarnish a railroad's mark.
I think I'll leave it at that.