Gill seems to understand that on the fourth day people would have already been recovered:
that they abode in their places in the camp till they were whole: till the wound made by circumcision was healed; now as it was on the tenth day they passed over Jordan, and came to Gilgal, where they were circumcised, there were three entire days between that and the fourteenth, when they kept the passover; during which time they kept within their tents in the camp, being unfit to move from thence, for on the third day of circumcision they were usually sore, Genesis 34:25; but being well on the fourth, were able to attend the passover. As the providence of God greatly appeared in favour of Israel, by causing a dread to fall on their enemies, that they durst not sally out of the city and attack them; so it showed great faith in Joshua, and the Israelites, to administer circumcision at this time, just as they were landed in an enemy's country; and when the waters of Jordan were returned, and there was no going back, and if they could, as they were not in a condition to fight, so not to flee.
However, I would strongly disagree with the premise of the question, as the whole "third day is painful" idea is likely incorrect. The proof text of Genesis 34:25 proves nothing about this case, as there is a big difference between fighting a war and having something to eat (See Barnes here). Secondly, as noted in the comments, in Genesis it was only 2 days later, here it was up to 4. Thirdly, we have the previous verse in Joshua testifying that the nation had healed:
And after the whole nation had been circumcised, they remained where they were in camp until they were healed. (5:8, NIV)
Most importantly, various calculations have been made as to what percentage of the nation was part of the group that needed to be circumcised (see various commentaries here). Even based on the most expansive estimates, there were still at least 2/3 of the nation who had already been circumcised, and could assist the others. However, in Genesis, the entire city had been circumcised at that point, leaving no men to help defend the city.