The FBI has agreed to pay more than $22 million to settle a class-action lawsuit alleging female recruits were singled out for dismissal in training and routinely harassed by instructors with sexually charged comments about their breast size, false allegations of infidelity and the need to take contraception “to control their moods.”