The U.S. government is in the late stages of an investigation into YouTube for allegedly violating children’s privacy, according to four people familiar with the matter, in a probe that threatens the company with a potential fine and already has prompted the tech giant to reevaluate some of its business practices.