You probably can't know. The ground truth would be if YouTube were spun out and had to rent its infrastructure from Google directly via Google Cloud. But GCloud doesn't actually sell the infrastructure they use, as far as I know - for instance the search engine, the ads engine, the anti-abuse engines, Borg, the edge networks. AFAIK most of the stuff that YouTube relies so heavily on isn't actually available to buy at any price.
Pricing is hard work, too. What price should Google charge to license out their search engine tech for competing video sites? There's no existing market for that kind of tech that could provide an obvious price point.
For an integrated operation like Google/YouTube you can't ever truly say if it's profitable or not. The division of costs and benefits will always be rather arbitrary.