For others reading this post, the reason why the imported batches did not apply correctly to the invoices was that the import template was defaulting the H and D record characters. I expected this to be OK, but it turns out it was not. When the H and D characters were added to the import file and template, the batch imported successfully with the payments properly applied.