The average damage is not identical. The average would be the same only if you allow continuous rerolling of 1's and 2's. If you wanted to allow that, while also minimizing time spent rolling dice, the better way to do it would be to change the d10 to a d8+2, not to a d12.BTW an advantage of using a d10 pole-arm like a halberd and taking GW fighter at second level is it allows you to ask DM to use a d12 instead of a d10 with the re-roll feature. The average damage is identical and ... you don’t waste time on the re-roll.
The formula for how much extra damage you get from the style as written is, for an n-sided dice: (n-2)/n. A d10 weapon will average 4/5, or .8, of a point of damage more.
Allowing continuous rerolling or its equivalent will increase the damage gained on average by 1 per die rolled. One could argue that this is a good thing as the style is weaker than others and could use some buffage. But do note that it exacerbates the already exiting problem of it being much better for greatswords and mauls than other weapons. As it stands the 2d6 gets half a point more damage from the style than a d12 does (2x2/3 vs 5/6). If you stop limiting rerolls that increases to being a full point better.
I dislike having some (otherwise equivalent) weapons doing d12 and others doing 2d6 on general principles. When you add in the way those differences interact with the questionable way they wrote Barbarian extra critical damage and great weapon fighting style I absolutely hate it.