Controversial six-figure bonuses for Network Rail bosses have been approved, despite criticism from the prime minister and unions.