All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
If those workers apply for a leave with the administration and the administration agrees and you take their shifts based on the instructions from the factory administration, then there is no harm in this and no sin on you, because you did not help them in attending evil. Taking their shift was done due to the requirements of the work, which include that the person who is present substitutes for the person who is absent due to their vacation.
However, if you work in their stead with an agreement just between you and them and not based on the instructions of the administration, and were it not due to this agreement, then they would not be absent, then there is no doubt that in such case you would be helping them in attending their festivals of falsehood, so we do not see that it is permissible.
The fatwa of Shaykh Ibn Baaz reads about the festivals of non-Muslims and the position of the Muslims about it reads, “It is not permissible for the believer (male or female) to help them in anything in this regard, because they are festivals that are contrary to the Shariah. It is not permissible to take part in it nor to cooperate with them (in this regard)…”
The fact that they work in your place during the legitimate festival that is beloved to Allah and which Allah is pleased with does not justify that you help them in attending the festival that is hated by Allah and which Allah forbids. The point here is not dealing with them in a like manner. If someone gives you a glass of water, it is not permissible for you to offer him a glass of wine if he asks for it.
Allah knows best.