Use a composite key
Group by carrier, invoice and BOL or tracking together. The same tracking number on separate carrier invoices can represent a rebill, so review those pairs separately before classifying them as duplicates.
Preserve the source order
The first appearance is the candidate payable line. Mark later appearances with both references. Compare the invoice image if two rows share an ID but carry different amounts or represent separate charge lines.
Reconcile duplicates to AP on import
Leave duplicate rows visible with zero approved dollars. The Duplicates sheet in the workbook includes both the retained line and repeated line for review.