Government lawyers argued that social media use posed risks to children, and action is needed to protect them.