Can the player with battlecards left still play a last battlecard (if he gains/has the initiative)?
Of course. And he wins.
If he is without initiative, he is still the winner (rule 14.10 "The defender wins if the attacker has no BCs remaining at the beginning of a battle round (even if the defender also has no BCs remaining).").
Or will the last matched card counts for the retreat table?
The "unmatched" card counts (rule 14.11 "The number of rounds that occurred in the battle determines the column to use on the table. The last round in the battle (the one in which the defender could not match the attacker) is counted as a full round.").
If the player with more battlecards may/can play a last battlecard (which cannot be matched, cause the other player is out of cards) it will be more easier to destroy an army (reserve 1 double envelopment for your last card... ;-)
If the defender is afraid of such a situation, he can simply choose to lose the battle one (or more) round earlier. You aren't forced to match the card of the attacker, even if you can.