for (int j = 0; j < attackers.Length; j++)
{
attackersPos = attackers[j].transform.position;
defendersPos = defenders[j].transform.position;
You are assuming here that the defenders' array is the same length as that of the attackers. If the defenders' is smaller then you will quite logically get the error you see. You must check the index is valid before you try to use it. Alternatively make sure both arrays contain the same number of items.
[edit]
You also have a problem in this code:
agent.SetDestination(attackers[j].transform.position - spaceBetweenEnemies);
j++;
You are incrementing
j
, but it is already being incremented by the
for
statement above, so it could well be set to an invalid number.
[/edit]