Given a list of test execution records, return the final unique failures after deduplication. Each record is a dictionary with keys test_id, status, timestamp, and message. Keep only records where status == "FAIL", and if the same test_id appears multiple times as a failure, keep only the most recent one by timestamp. Return the result sorted by ascending test_id.
def deduplicate_failures(records):