In the case of
(A) of (B) VERB ...
Though it is typically the first noun (A) that the verb agrees with, there are cases of what the Cambridge Grammar of the English Language (p502-3) refers to as number-transparent nouns where the verb agrees with a plural (B) instead of singular (A). Consider:
A number of spots have/*has opened up.
Here the verb agrees with spots, not number.
Another example where agreement with the plural (B) is the only grammatical option would be with majority, as in:
The majority of her friends are/*is German.
Other nouns seem to be open to both options.
At the corner of Eighth and Twenty-first, a group of boys push
past me. (The Haunted; Swan, Susan (Canadian novelist); 2019)
A group of boys is never up to any good. (Bound south :a novel; White, Susan Rebecca; 2009)
The list provided in CaGEL of nouns that either require the plural override or allow it are band, batch, bunch, class, couple, flock, group, herd, host, majority, minority, number, party, rash, set. Though train is not included, there are some examples to be found of the number-transparent version:
Moments later, a train of bulldozers roll down into town. (Red
Man's Greed Transcript at IMSDb;
https://imsdb.com/transcripts/South-Park-Red-Man's-Greed.html)
Now, take it in which of these views you please, (for there is no
material difference,) and this is the whole and sole perfection, as a
train of writings prove to a demonstration, which I have believed and taught for these forty years, from the year 1725 to the
year 1765.
(http://wesley.nnu.edu/john-wesley/a-plain-account-of-christian-perfection/)
The most popular is the Indian wedding, where a train of musicians
sing, beat on drums and ring bells around the plaza.
(https://travel2next.com/things-to-do-in-san-jose-ca/)
My Lords, everyone knows what a train of evils follow in the wake of
overcrowding (Mr Albert York, British Parliament - House of Lords,
1898)
Of course, the writing above may be judged to be of questionable quality (or just plain dated in the last case), though they seem natural enough.
Where the plural override is used, the (B)s seem to be thought of separately, as in spots opening up one by one, boys pushing past one at a time, and people with individual German ethnicity; rather than multiple spots opening up at the same time, boys bunched together pushing past, etc.