In Japanese media, Mythical Pokémon and Legendary Pokémon have always been presented as distinct groups. In non-Japanese media prior to Generation V, Mythical Pokémon and Legendary Pokémon were both considered to be Legendary Pokémon (and the term Mythical Pokémon was unused); since Generation V, the two groups are presented as distinct groups in all official media.
Source
Mythical Pokémon are a related but separate group of Pokémon, which are usually event-exclusive.
Ultra Beasts are not designated as Legendary in any official media. They are in fact common Pokemon, just common Pokemon from another dimension.
Hope I helped!