The federal government has settled a class-action lawsuit with military members who were subjected to racism during their time in the Armed Forces.