So, tell me what you think it means then.
Jesus divides the nations like a shepherd divides the sheep from the goats. He welcomes the sheep into His kingdom based on the fact that they did the right works concerning Jesus' brothers. The sheep cannot be accounted as the group "Jesus' brothers", because who they are is determined by their actions towards others, not themselves, specifically Jesus' brothers therefore, Jesus' brothers, as referenced in this passage, are not the sheep.
And of course that two gatherings are named.
These sheep and goats, they are determined righteous or not based on their works. Those who are "in Christ" are specifically not. We are righteous because we've received Christ's righteousness. Personal works of righteousness towards salvation are eschewed by Paul throughout his letters.
Yet these are judged righteous based on their works.
If the Church - that is specifically, those who are "In Christ" were part of this gathering, the declaration of righteousness based on works would be wholely out of place. If those "in Christ" were a part of the gathering of the elect, then from where come the sheep?
But if you aren't willing to hold to that exact wording of the passage - I'm sorry - if you don't take the narrative just as written, then you aren't limited to these facts.
I take it just as Jesus prophesied, in the normal terminology of the day. "Elect" wouldn't be used of gentile Christians for 30 years or so, when Paul was writing his letters. And we don't take a later usage of the word by someone else to determine what an earlier speaker meant. We should - what I think - go by the normal customary meaning of the language at the time it was said. In other words, the Historical Grammatical Hermeneutic.
And when Jesus spoke of the Chosen, and the Nations, there's not a doubt in my mind what this meant at that time, to those people.
Much love!