In no way does "Legendary Pokemon" ever meant to be "cannot be defeated easily". All a Legendary Pokemon is is one that is defined as such by GameFreak, Nintendo, etc... All the fan-made rules of what constitutes a Legendary Pokemon often are invalid a generation or two later (The Kanto Bird trio aren't tied into the plot of any game, Latios/Latias/Heatran all have genders, Shaymin can have two different abilities, the Golem trio have a non-Pressure ability, etc...).
Typically, Legendary Pokemon are challenging to catch in-game, if they're able to be encountered. But what happens in-game in the Gyms and E4 challenge is a different environment than what happens on a battle simulator.