In Game Of Thrones S7E5, we see the Brotherhood is detained by Tormund, but I can't seem to remember in which episode they caught them. Was it ever shown?
It wasn’t shown and happens off screen. The last we see of the group is at the farmhouse of the farmer and his daughter that Sandor had encountered earlier with Arya. This is in season 7 episode 1, “Dragonstone”. The next we see of them is in the cell in season 7 episode 5, “Eastwatch”. Note that in the episode there is a brief explanation for them getting caught, though it was probably somewhat deliberate:
Tormund: My scouts found them a mile south of the Wall. Said they were on their way here.
Game of Thrones, Season 7 Episode 1, “Eastwatch”
This brief explanation is in place of the scene being shown as it really isn’t necessary to show it and would have just added noise to the season.