Given your shapes and the posted for loop, this would work:
B, N, M = 4, 5, 6
verts_padded = torch.randn(B, N, 3)
faces_padded = torch.randint(0, B, (B, M, 3))

out = torch.stack([v[f] for v,f in zip(verts_padded, faces_padded)])

res = verts_padded[torch.arange(B).unsqueeze(1).unsqueeze(2), faces_padded]

print((out == res).all())
> tensor(True)