the US loses, potentially quickly but more likely after a longer fight, and Polk gets impeached and in the worst case, the Free States secede from the Union
Although the Navy was as strong as it would be in the 19th Century (not counting a brief interval in the Civil War) vs the British, and the Army is pretty good and had one of the best generals the US Army would ever produce, it is still small and Oregon Territory and Texas are too widely separated not to mention the coast is too big to defend without rail to move troops around quickly