Differentiating the term "UI" and "HUD" in games
In video gaming, the HUD (head-up display) or Status Bar is the method by which information is visually relayed to the player as part of a game's user interface.
The HUD is frequently used to simultaneously display several pieces of information including the main character's health, items, and an indication of game progression (such as score or level).
(Wikipedia)
I assume menus aren't part of the HUD.
What's the difference?
Solution 1:
UI (User Interface)
UI refers to the methods (keyboard control, mouse control) and interfaces (inventory screen, map screen) through which a user interacts with a game.
HUD (Head-Up Display)
In video gaming, the HUD (head-up display) or Status Bar is the method by which information is visually relayed to the player as part of a game's user interface.
Verdict
Looking at these definitions, the HUD is actually a part of the UI as it can have an effect on how the player interacts with the game.
For example, the Overwatch HUD which displays when an ultimate is ready to use:
Summary
When looking at the definitions and examples of how the HUD can impact the UI, it seems as though there is no right or wrong answer, as the phrases and the uses they hold in game, support each other.
Neither word should be used over the other, as they work together.
(I apologize if this answer is hard to understand, I tried to explain it as best as I could)
Solution 2:
HUD is short for heads-up display, which is a method of displaying (usually graphical) information in a way that overlays normal vision. For example, icons or other info can be displayed on the window in front of a pilot in an aircraft. This allows a pilot to be notified of important information while not taking their eyes off the terrain or opponents while flying.
In video games, HUD usually refers to the graphical information around the edges (or if translucent across the entire screen) of the 'main' playing window. So in first person shooters the symbol for the weapon you are carrying, the ammo it is loaded with, and your health levels are usually part of the HUD.
UI, or user interface refers to all the methods for interacting with a system (or game), both system to user (vision, sound, tactile) and user to system (mouse/keyboard/other controls). Joysticks, mice, microphones, switches, buttons, keyboards, pedals, lights, speaker sounds, and anything displayed on a computer monitor are all part of the UI. As James Smith says in his answer, a HUD is a (sub)part of the total UI.