My guess is that the reason for the exponential time increase is that the whole file is being imported in a single transaction, so the database server is getting bogged keeping track of a very large transaction.
I would try one of the CSV import modules in the Marketplace. This one: https://marketplace.mendix.com/link/component/108605 enables you to read and process a CSV file line by line which means you can process each row in a separate transaction to improve performance. It will take a bit of work, but I think this is the way you’ll need to process this file.