Yes, that’s the type foam weatherstripping that should be around the window. Usually it’s put on the window side (less visible) like you said your was (but deformed). I also put a piece across that metal part of the latch on the window. The figure shows stopping it on either side but I put a piece all the way across to seal that area
If that bottom, front corner is the problem, usually it’s the latch adjustment that can be changed to pull the window in tighter. The screw holding the window latch into the window should have some plastic washers used as spacers, You can simply add or remove some of the spacers to make it so that you have to pull that window fully shut up.