US Marine have long ago grown from the original role of Marines as just ship board guards and snipers working for the Captain.
The Marines would be under something similar to today's Special Operations Command. The USMC might train, house and feed them but made operational they would work for the force commander, no matter what service
They were not organized as USMC platoons and USAF gate teams as far as I can tell. There was no reason to have separate USMC, USAF and Allied military contingents as far as my limited watching of Atlantis can prove. Administratively Lieutenant Ford may have completed the boring task like fitness reports as the senior rater of Marines but his primary task seemed to be a gun fighter and adviser to Major Sheppard who was a helicopter pilot who happened to have special DNA.
In the regular forces a Lieutenant might bring his platoon in total to be tasked organized into another unit's company. In those cases the small unit commander would continue to command his, he might even take over the larger unit he is attached to if their leaders become casualties
[Does this sort of thing happen in the RL military where officers from one branch take command of units from another branch
Happens all the time. We know about theatre commanders, the Eisenhower's and MacArthur's having their own navies and air forces along with allied nations troops to command. In Special operations it can and often happens at much lower levels of task organization. Down to the single of pair of USAF Special Ops Combat Controllers who are commanded by the SEAL, Ranger, Force Recon, Special Forces teams they normally support in the field. Outside of Stargate most are commanded while deployed by officers of different services.