It is very possible to lose fat by just weight training! The problem lies when you try to burn fat and gain muscle at the same time, that's nearly impossible despite all the gimmicks online that trick you into thinking you can by buying into their fad diet or workout routine.
Diet is the important thing. As long as your are eating clean and you are at a caloric deficit, then you will lose weight. Building muscle is the opposite, you need to be at a caloric surplus in order to build the muscle and gain weight. See how it would be extremely hard to be at a caloric deficit and caloric surplus at the same time? That's why you cannot build muscle and lose fat simultaneously.
Nutrition Minor in College / Gym rat