So are the drivers of ships called Captains. I guess when you operate a big vessel the appropriate title is Captain.
Airline captains have very specific training that they undergo in order to become a captain and then continuous training at least twice yearly. There is no swearing in ceremony that I'm aware of, but they definitely work to get the title.
I am not a pilot but have a brother and brother-in-law who are airline captains. They both work very hard.