About equivalent to Imperial Japan's odds of winning WWII against 1940s America, or slightly worse.
You probably would say the same thing between Britain and the Boers. That didn't work out too well for Britain OTL.
The USA of 1840 already was an advanced industrial power. They already had experience in war such as the War of 1812 and the establishment of military academies such as West Point. Furthermore, if the USA were to go to war with Britain in this time period over North America, the USA would have one important advantage on its side: logistics. And the USA didn't have any overseas colonies for Britain to seize as leverage.
If the USA of 1840 was committed to a long war for North American territory, they would win. As for Japan vs USA in 1940, Japan never had a chance not only because of the fact that the USA was bigger and more industrialized, they didn't have logistics on its side. The Britain of 1840 wouldn't had logistics on its side in a war against the USA over North American territory.