The Ewoks didnt really deafeted them. They had just pure luck because they know their homewoods much better than the Empire. And they merley (dont know how that word is written again) distracted the Stormtroopers. In fact this battle in the movie was kind of similar to the Germanians vs the Romean army in the Varus Battle. It doesnt matter how much technology you have, you also need to be suited for the enviroment around you and the Stormtroopers were not suited for the enviroment of the forest. And their armour was a disadventage too. And it doesnt matter that the Scout Troopers were awesome, they clearly underemesitated the Ewoks who knew their home inside and out.

Sorry if i sounded rude, but i like the Ewoks nonetheless because they were fresh and funny for the movie and i find them incredibly cute. But the actors of the Ewoks must have really gotten hot under These costumes.