Just from watching these hands, the number one thing you can do to avoid these types of situations is raise substantially before the flop. Not only does AK perform better against fewer opponents, literally any hand will have more equity (% chance to win) against fewer opponents. Having fewer opponents also makes it easier to read the hands of others and win with less absolute hand strength (i.e., it is easier to win with 1 pair against 1 opponent than it is to win with 1 pair versus 6 opponents…). In situations like these with 9 players where everyone is limping and playing passively, I would play only very strong hands (possibly TT+/AQ+) and raise them big (3x or more +1bb per limper). You will get unlucky and crash out sometimes, but stealing 8 big blinds is not bad and when someone does call you are probably still ahead of their range.
In the first hand A3o is not good enough to raise, so limping behind is fine. I would probably fold though, because A3o does not flop well. What do you expect to hit with this hand? If an Ace flops, someone likely has a better kicker. Even if you flop a straight, there can be a better straight. Even if you end up with a full house, there can be better full houses. Basically, the chance of hitting something strong is low, and even your best case scenarios aren’t great.
As played, don’t raise the flop. Calling is fine, but you have bottom pair, so you are essentially bluffing, but with so many players, there is a good chance that you will get called. You played the turn fine and river fine, but remember that your full house is quite low. When you see a flop with so many players, there is a very good chance that by the river one of them has a massive hand (like 99/55/A9/A5). You wouldn’t expect to see AA played so passively, but not too surprising in these games.
The other hand is once again kind of unlucky because you had a good hand and theirs was massive. These two opponents played AA and QQ so passively that they are losing a ton of value in the long run, but it worked for them here. My only comment on your play in this hand is again that your initial raise should be much larger, like 160. Your bet on the turn should also be larger. Their min-bet made no sense, but you should be betting at least 800, possibly a lot more.
Once they go all in I usually give them credit for a huge hand like 33/KQ, especially because so many players got to see the flop, though they definitely should not play QQ this way. But because they could also be overvaluing another king, it is ok to call. Just bad luck that they were so strong when you had trips top kicker.