It's interesting how the Trent Affair of 1861 nearly brought the U.S. and Britain to blows... Both realized that war between these two nations would benefit neither. England would surely lose Canada. International trade would be in great jeopardy for the U.S. due to England having a much larger blue water navy. Moreover, such a war would draw much manpower and treasure from forcing the Confederate states back into the union. Still, the north fought that war with one arm behind its back. Had a war developed between England and the United States, the full industrial power of the nation combined with an overwhelming national will would have had a huge effect. It's important to note that the U.S. would dominate coastal waters and the St. Lawrence. In addition, we must consider that France was flexing its muscle in Mexico at that same time, and that was yet another distraction that the U.S. wanted to avoid.
By 1865, the U.S. Navy had 471 combat ships in service, and fully 1/3 were riverine vessels. The huge Union ironclad fleet was extremely formidable, and no nation on earth could successfully challenge it in its home waters. Then there was the Pacific, where Britain would be more hard pressed to project power very far beyond their colonial holdings. To engage the U.S. Navy successfully, Royal Navy assets would have to be drawn from Britain's many world-wide commitments, something England was not especially interested in having to do. In 1861, with the prospect of a long, expensive war, and the loss of considerable trade revenue for each nation, both wisely sought to settle things diplomatically, which they did. By late 1862, British intervention on behalf of the Confederacy was impossible. Once the American Civil War became a war to end slavery, there was too much to lose and little to be gained by England by throwing in with the southern rebellion. After the Emancipation Proclamation, if the Confederacy was to become a recognized independent nation, it would have to do so without outside help.
This point in time, I think, was the where Britain's naval power began to shrink in power relative to that of the United States. Still, it would take more than 30 years for the U.S. Navy to have the sea power required to thwart European influence in the western hemisphere.
As to the War of 1812, the U.S. Navy possessed the best Frigates on the planet, with excellent commanders and crews. However, the sheer size of the Royal Navy was such that in anything resembling fleet actions, the Brits could handily overwhelm with numbers, if not in technology or individual ship quality. Ultimately, the U.S. Navy would have to fight a war of commerce raiding, using their superior Frigates to chew up British merchant shipping and drawing much of the Royal Navy's combat assets into guarding shipping and pursuing the very fast and powerful Frigates. Lacking anything near the power to challenge the Royal Navy nose to nose, it would become the naval equivalent of guerrilla warfare. A persistent and troublesome problem for the Royal Navy, but not something that would prevent the Brits from going anywhere they wanted when they gathered adequate forces.