From the tramp multi-hops configuration webpage
(add-to-list 'tramp-default-proxies-alist'(nil "\\`root\\'""/ssh:%h:")) (add-to-list 'tramp-default-proxies-alist'((regexp-quote (system-name)) nil nil))
Then any
C-x C-f /sudo:remote-host:/file
will open file using sudo after logged with the same username of the user running emacs but on the remote machine.