Because these are two different lawsuits, there is no conflict and the representation will not harm the interests of the other party.
Therefore, this situation does not violate the Lawyers Law and Lawyers’ Professional Ethics, and lawyers can represent them in litigation.