Swapping the training and validation loop might change the order or calls into the pseudorandom number generator and might thus yield a different final accuracy.
You could rerun both approaches with different seeds and check this behavior.