From a conservative Evangelical perspective I suggest that the main and contextual theme of the larger passage from which you excerpted verses 41-46 is judgment. Not just any judgment, however, but the judgment of an all-knowing King who knows the righteous from the unrighteous.
As for the eschatological implications of this passage, I won't dare to speculate. I will suggest, however, that the King is Jesus Christ, described in Matthew 24 and 25 as the "Son of Man" (25:31), and his ability and worthiness to judge are taken for granted both here and elsewhere.
The separation of sheep from goats, as I've already intimated, is Jesus's way of illustrating the judgment process by which he will one day distinguish the righteous from the unrighteous, the true believers from the unbelievers, the ones who are truly God's children through the new birth from the ones who are not.
As for what appear to be criteria for being judged to be righteous (viz., feeding the hungry, giving drink to the thirsty, inviting the stranger in, clothing the naked, taking care of the sick, and visiting the imprisoned), Jesus is not teaching salvation by works.
As has often been said, the salvation which is by faith alone does not come alone. With the new birth (or birth from above, or regeneration) comes the God-given ability to demonstrate saving faith through good works, but not the requirement to earn salvation through good works.
Even the unrighteous in the current age in which we live perform the sorts of good deeds mentioned by Jesus, and more. They spearhead efforts to eradicate disease, they contribute money to worthwhile causes, and they campaign for reforms which will benefit every segment of society, particularly the downtrodden, the oppressed, and the have-nots.
A common utterance among the rich and famous is "I just feel the need to give back," whether that giving back is to the community in which they grew up or perhaps to a cause with which they identify. Another common expression is "to pay it forward," which suggests that generosity--even anonymous generosity, for example, has a way of becoming contagious. In helping others, people express their gratitude for having been helped themselves.
All these sentiments and good deeds are commendable. What will one day literally separate the sheep from the goats is a matter of motivation. On the one hand, the righteous care for the hungry, the thirsty, the outsider, the naked, the sick, and the imprisoned, and they do these things as unto the Lord. Their primary motivation is to please the Lord and not to receive the accolades of the world nor to contribute one whit to the salvation already proffered to them at great cost to their Savior and Lord, the Good Shepherd who gave his life for the sheep (see John 11:10 and 14).
On the other hand, the unrighteous, though they are not necessarily lacking in good deeds, fail to perform those good deeds as unto the Lord. Jesus said,
Truly I say to you, to the extent that you did not do it to one of the least of these, you did not do it to Me’ (Matthew 25:45, my emphasis).
You ask if we "have a duty to help other people in general." Yes. Christians do have a duty to help other people. Clearly, we demonstrate our love for God by loving our neighbor as we love ourselves (see Matthew 22:36-40). That love may be expressed in seemingly small and seemingly insignificant ways (such as a cup of cold water given in Jesus' name--see Matthew 10:42 and Mark 9:41), yet when performed "as unto the Lord," God takes notice and rewards it.
In conclusion, Jesus' words are indeed challenging for both the righteous and unrighteous. For the righteous, they can fail to see Jesus in the person they are called to serve. What is more, they can begin to treat their good deeds as onerous duties rather than joyous acts of service. Worse still, they can become self-congratulatory and proud about what good little Christians they are, rather than recognizing they are but unworthy servants who owe their master a debt which can never be repaid.
For the unrighteous, Jesus' words are the death knell to a works-based salvation, since no amount of good works can merit the gifts of God's forgiveness and eternal life. As with Israel of old, so also with unbelieving Jews and Gentiles today (that is, until they throw themselves upon the mercy of God for the radical cleansing they need),
All of us have become like one who is unclean, and all our righteous acts are like filthy rags; we all shrivel up like a leaf, and like the wind our sins sweep us away (Isaiah 64:6).