(The above rendering comes from the RJPS translation, an adaptation of the NJPS translation. Before accounting for this rendering, I will analyze the plain sense of the אִישׁ terms, by employing a situation-oriented construal as outlined in “Notes on Gender in Translation,” pp. 11–16.)
These usages of אִישׁ are conventional: they profile their referent as a distinct entity within a larger military force—for Israel’s force has consisted of Judah’s contingent plus that of the other Israelite tribes, with both ostensibly under the king’s unified command. The latter militia is still regarded in those terms, even when they are insubordinate.
A “collective” construal of אִישׁ יִשְׂרָאֵל is evident grammatically, from the application of the quantifier כׇל; and likewise for אִישׁ יְהוּדָה from the third-person plural inflections. On the regular usage of singular אִישׁ as a “collective” term in the context of hostilities, see my comment to Judg 7:23. On its occasional use to denote a contingent of military forces, see my comment at Judg 7:24.
As for rendering into English, the NJPS ‘All the men of Israel’ and ‘the men of Judah’ miss the situational nuances. On properly rendering the collective usage of אִישׁ into idiomatic English, see my comment at Josh 10:24.