Racial prejudice undermined safety at Network Rail works site