They were divided into two groups.

Literal

They [topic-は] two groups [into-に] were-divided.

分けられた is the passive of 分ける ('to divide'). 二つのグループ mixes Japanese 二つ with the loanword グループ.