There are many factors which go into this determination, most of these factors cannot be controlled by the player, so the real answer is: Flip a coin.
The exact answer is that the first one to get to the province center will capture the province. This does not mean that the one landing the killing blow will automatically get there first.
If there are simply two armies and they both move to capture the capital at the same time after the last enemy is defeated, then the one that is closer will get the capital first, as they were closest. The combat range of all units is 5 km, but not all battles start immediately at the 5 km range if the order is not "attack", so some units might be closer to the province center than others.
If either army is in the middle of a countdown to the next attack when the enemy is defeated, they may not process that the path is clear immediately, so in that case the first army to move will get the province. This might not even be a participant in the battle if for example an armored car is timed to arrive at the province center simply a split second after the killing combat blow.
So to summarize, it is a race to the finish line, and you have no way at all of knowing who is ahead until it is over.
Now if you are at peace with the other party, the moment that either of you capture that province you will be at war with each other, so keep that in mind.