The "rapture" IS the second coming of Christ. This occurs, as you said, in chapter 24. The sheep and goat separation in chapter 25 is:
Mat 25:31 "But when the Son of Man comes in His glory, and all the angels with Him, then He will sit on His glorious throne.
Mat 25:32 "All the nations will be gathered before Him; and He will separate them from one another, as the shepherd separates the sheep from the goats;
It corresponds to:
Rev 20:11 Then I saw a great white throne and Him who sat upon it, from whose presence earth and heaven fled away, and no place was found for them.
Rev 20:12 And I saw the dead, the great and the small, standing before the throne, and books were opened; and another book was opened, which is the book of life; and the dead were judged from the things which were written in the books, according to their deeds.
This is the sheep and goat separation AFTER the thousand years have passed:
Rev 20:5 The rest of the dead did not come to life until the thousand years were completed. This is the first resurrection.
Rev 20:6 Blessed and holy is the one who has a part in the first resurrection; over these the second death has no power, but they will be priests of God and of Christ and will reign with Him for a thousand years.
Here's the timeline. Christ returns. At his return, those who are Christians either alive, or dead, are resurrected to spirit bodies. This is the first resurrection. They live and reign with Christ for a thousand years. After the thousand years, all nations, the rest of dead, are judged by Christ, who sits on the great white throne.
You're making an assumption in Matthew 25 that no time passes between Christ's return and the judgement of the nations, non-Christians. This is shown in Revelation to not be the case.