Both options are valid and your explanations are correct.
The difference is in treating the segmentation use case as a binary segmentation (first option) with nn.BCEWithLogitsLoss and a single output channel or as a 2-class multi-class segmentation (second option) with two output channels.
From what I saw in other posts the first option is often preferred, but the second one should also work.
@KFrank is an expert in these topics and might want to add something.