The settlement follows the largest group legal action brought by midwives in the UK, says union.