Unsure, what might be the issue, but I can perfectly overfit a random sample using your code:
model = UNet()

x = torch.randn(1, 1, 256, 256)
target = torch.randint(0, 2, (1, 1, 68, 68)).float()
criterion = nn.BCEWithLogitsLoss()
optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)

nb_epochs = 100
for epoch in range(nb_epochs):
    optimizer.zero_grad()
    out = model(x)
    loss = criterion(out, target)
    loss.backward()
    optimizer.step()
    print('epoch {}, loss {}'.format(epoch, loss.item()))

preds = (out > 0.0).float()
acc = (preds == target).float().mean()
print(acc)
> tensor(1.)