The idea was never going to be an easy one to sell. Italy's state-owned railway corporation, Trenitalia, decided to replace the traditional first and second classes on its high-speed trains with four categories.

And since the occupants of fourth-class will not be allowed to use the on-board cafeteria, or even set foot in carriages reserved for better-off passengers, it was already facing accusations of introducing a form of segregation. By Wednesday, however, the company was preparing to defend itself against claims of outright racism.

Its problems arose after the release of a web commercial designed to get travellers used to the new reality. The top tier, executive class, was illustrated by businesspeople at work in a special conference room. The next best, business class, was depicted temptingly empty. Premium had a couple taking drinks from a trolley pushed by a uniformed hostess. And standard, the most basic class, was illustrated with a picture of a black family.

Attention was first drawn to Trenitalia's video by a blogger, Alessandro Gilioli, on the website of the weekly L'Espresso, and it soon triggered a torrent of complaints. "Grotesque" and "This is called racial discrimination" were among the more polite comments on Twitter, Facebook and other social media sites.

The video was hastily withdrawn on Tuesday evening and replaced with a new version in which the occupants of standard class are depicted as, first, a smiling, chattering white couple and then a family – also white – playing a game together on an internet-connected tablet. The businesspeople in executive class now include two non-white women.

The company had not made any statement on the affair by Wednesday afternoon. An official said one was being prepared.