Does word "title" have the same meaning in the following two sentences?

The professor didn't like his friends to use his formal title.

He held the title for two years.
different meanings