Hi,
You can merge the contacts, but Odoo will only keep one department for the contact. After the merge, you can go into the contact and manually add the other department in the Job Position field.
Here are some pictures to guide you through the process of merging duplicated contacts.


If this was helpful, feel free to mark the answer as correct.
You could probably achieve this with export / import and then in the Excel you could set the contact to have multiple departments. After that you merge the contacts.