Shahādat is the testimony being accepted; rajulayn is a dual genitive governed by the iḍāfa structure, hence the yāʾ ending.
Imraʾatayn is the feminine dual in the genitive, conjoined with rajul in the alternate witness configuration. The Arabic grammar preserves both the count and the composition of the witnesses.