Why did Luke take charge during the final Trench Run? Biggs and Wedge both have more experience than Luke, and they outrank him as well (its unlikely that Luke was given a high rank for his second mission in the Rebellion).
They don't outrank him - they are all regular pilots. And Biggs, at least, knows about Luke's piloting skills. He took charge because he was the best pilot (and because he was ordered to by Red Leader).
As already said, the pilots with lower numbers don't outrank Luke. When Red Squadron was originally formed this would have been true, but casualties leave gaps and mess up everything, Red Leader/Red 1 being the only exception. Rebel squadrons in the EU fly in pairs. Judging by dialogue Biggs (Red 3) was Luke's (Red 5) wing-man. By the time Luke made his run on the exhaust port, most of Red Squadron was wiped out. Wedge's wing-man was presumably shot down already, and Biggs was already watching Luke's back while Luke looked for more TIE fighters to blast apart. Hence, Wedge would take up position on Luke's other wing, allowing the trio to share shields. This particular formation is not really used in real life in combat due to being awkward, but here would be a case of reorganization. The Y-Wings of Gold Squadron would presumably be organized in the three-ship formation from the start since they were supposed to be the ones to blow up the Death Star in the original plan. A good chunk of this is fan speculation, but the rest comes from the EU. I hope this helps.
Plus, sometimes, during a crisis, it's not always the person with the most seniority or authority-by-position who takes charge, but sometimes someone farther down the chain who seizes the initiative. At this point, most of both squadrons have been blown to pieces, so there's little organization left of any kind. Luke stepped up, so he got to be in charge.