web build with Unreal is only possible in Unreal Engine 4.27 and earlier. 2d game is not a big deal to make lightweight, but Unreal isn’t an ideal choice for 2d. if you use itch’ search, you can find browser games made in Unreal and something like retro style horror is fully possible.
large size is surely thanks to realism and heavy assets, but a lot has to do with optimization as well. So the size isn’t exactly a fault of the engine, but more about experience of the developer, if it isn’t highly realistic game.
It was actually fairly easy to do the build for HTML5 in UE4. I just use Unreal Engine 5, so it was more about treading carefully because there’s a lot of differences. Current game has literally nothing outside one jpg that wasn’t a part of engine’s starter assets.
I was tinkering with UE4 before and wasn’t satisfied with how it went, but this jam something magically clicked and I made the game very fast.