I know that in DND-5e, the rage mechanic works against magical weapons that deal slashing damage, despite them being magical. However for certain enemies it is specifically stated "Attacks count as magical for overcoming resistances". I am wondering if in such a case, the enemies attacks would overcome Rage resistance.
Generally speaking, such a feature would not overcome the barbarian's resistances from their Rage feature.
First, for an example of such a feature, let's refer to the (NPC) archdruid's Wild Shape feature, which states:
The new form’s attacks count as magical for the purpose of overcoming resistances and immunity to nonmagical attacks.
Most of the features I'm aware of are phrased similarly enough to not make much of a difference.
The resistances that are part of the barbarian's rage are described as the following:
You have resistance to bludgeoning, piercing, and slashing damage.
This resistance does not care about the magical or non-magical status of the damage dealt to the barbarian, so "magical for the purpose of overcoming resistances" doesn't apply here. In the same vein, magical bludgeoning/piercing/slashing damage from a spell like catapult, or from weapon attacks with a magical weapon would be halved against a raging barbarian as well (see this Q&A for a more thorough breakdown on this).
This is in contrast to things like air elementals' resistances, which are phrased as the following:
Bludgeoning, Piercing, and Slashing from Nonmagical Attacks
Such a set of resistances would be overcome by a feature like the archdruid's, as the attacks counting as magical means that those resistances are inapplicable. Similarly, those resistances would be ineffective against magical attacks causing bludgeoning/piercing/slashing damage, such as thorn whip, or weapon attacks with magical weapons.
For another point of comparison, effects that intend to bypass general resistances that normally would apply seem to be more direct about it- for an example, see the vorpal sword:
In addition, the weapon ignores resistance to slashing damage.
This would bypass the resistances from Rage.