The ‘lang’ attribute has higher precedence but you may also set it with the Content-Language HTTP header they probably have a similar level of support.
Like was mentioned the one on the HTML applies to the content between the HTML element.
Usually you’ll see the ‘lang’ attribute also appear within other elements such as SPAN to target specific language change within a page’s content. For example: <span lang=“es”>Soy un perdedor</span> within a English document. It basically doesn’t harm having both options available.