Knee position while on the aero bar I find that my knees are coming ahead of the pedals while I am on the aero bars. I am not sure whether this is right or wrong.
In the below image, I don't feel pain on my lower back for a long duration but I am seated on the edge of the saddle. This results in a painful pelvic girdle. But I am worried that my knee is too far ahead of the pedal on the horizontal crank arm position.



In the below image, I am seated on the middle of the saddle which brings my knee a little closer to the pedal. But I experience lower back pain after a very short time.



I am afraid, both the positions are wrong because both the positions bring my knee in front of the pedal. 



Now my question is, where should my knee be with respect to the pedal or toes?
Also how to correct it (if wrong), should I reduce the stem length or bring my saddle forward? Invite other suggestions as well!
Currently the stem length is 100 mm.
Proper fit in an aerobar posture is designed to allow you to race well. In order to race well you will need to be comfortable enough to produce power, to reduce aerodynamic drag, and to handle the bike well and safely for the duration of your race. If your fit otherwise meets all your needs, you shouldn't be concerned about where your knee is positioned relative to the pedal. Under UCI regulations (see section 2 of chapter 3 here), the nose of the saddle should be a minimum of 5 cm behind a vertical line through the bottom bracket; morphological exemptions can be made to bring the nose of the saddle up to the bottom bracket. Some riders do not compete under UCI rules and the saddle can be forward of that; and many time triallists will sit only on the front half of their saddles, effectively bringing them even farther forward. The forwardmost position of the pedal will be determined by the bottom bracket and the crank length. Some riders use "short" cranks to improve their aerodynamic position, and that will also change the position of the knee relative to the pedal. The location of the cleat and the length of your foot will also determine where your knee is positioned relative to your toes. 

Optimize your fit to achieve your other goals. Don't focus solely on where your knee is positioned.