NEW YORK — Amtrak will pay $19 million to a group of former trainee workers who claimed they were fired from its trains in New York City because they were white, and the settlement will resolve a class action suit brought by the union.

The Federal Railroad Administration approved the settlement Tuesday, the agency said in a statement.

The settlement also requires Amtrak to establish procedures for handling complaints of racial discrimination.

In its lawsuit, the workers claimed they faced discriminatory training at Amtrak stations, including being told to “take a step back” and being told “white people will never be the majority” of its riders.

The trainees said they were told they could not use bathrooms and that they were being segregated from their peers because of their race.

Amtrak said in 2016 it agreed to pay out $6.8 million in back wages and other compensation to more than 2,500 former trainees.

The agreement includes $19.9 million to cover the cost of settling the class action complaint, which the federal agency said it “will be used to support the efforts of the trainees to secure justice.”

The settlement is not subject to the state antitrust laws, which are typically used to settle large class actions, said Jessica Rich, an attorney with the Center for Constitutional Rights, which brought the lawsuit.

A federal judge in California last year dismissed the trainee class action, but the case was appealed to the U.S. Supreme Court.