A dropdown does not take any action. The widget includes the javascript code to direct you to the translated page. The function 'pll_the_languages' does not include any javascript code because it is intended for developpers who want to customize the language switcher. You need to copy the javascript from the widget if you want the dropdown to do the same thing as in the widget.
Note: You should remove <ul>
statement if you use pll_the_languages to output a dropdown. This is needed only when it outputs a list.