This sentence has problems, but with respect to the plural/singular distinction it is acceptable.
In the head clause, Credit card companies use, the author speaks about what all these companies do: they all use negative balances, they all use positive balances.
But in the subordinate clauses, the author is speaking of when these representations are used: in individual instances, on the statements sent one by one to customers.
This is not to say that employing the plural would be formally incorrect:
... Companies use negative balances to represent when the companies owe the customers money, and positive balances to represent the customers owe the companies.
But this could be misunderstood. It might be taken to imply that the representation is determined by the aggregate balance—the total amount owed by all customers to all companies minus the total amount owed by all companies to all customers.
In this case, of course, that would be so absurd that nobody would actually understand it that way. But in other contexts, an aggregate reading might be reasonable.
In the table below I employ a yellow highlight when the customers owe the companies more than $800B and a blue highlight when the customers owe the companies less than $750B.
Consequently, we ordinarily employ this plural/singular distinction so the meaning will be unambiguous.