In The First Avenger, how did newly enlisted James Bucky Barnes get the rank of Sergeant? That's 5 ranks into service.
Sgt. James "Bucky" Barnes hadn't just enlisted...he'd been in the army some time before the events in Captain America: The First Avenger
During Bucky's visit to Steve he confirms that he's received orders to ship overseas.
Rogers: You get your orders?
Barnes: The 107th. Sergeant James Barnes,shipping out for England first thing tomorrow.
This indicates at the very least that he has completed basic training.
As for how he made Sergeant, we have no information. Basic training would have taken about six weeks so it's possible he was deployed once before and received a battlefield promotion...or that he received promotions during extended training by demonstrating leadership skills.
Unfortunately, we just don't know....yet.
Regarding his enlistment.
Captain America: The Winter Soldier indicates that he enlisted in 1941 immediately after Pearl Harbour.
As shown in Captain America: First Vengeance Part 2, the canon prequel digital comics for "Captain America: The First Avenger", Bucky and Steve attempted to enlist in 1941, year or so before the events of the movie. Steve was 4F'd, Bucky was not.
Back in 1941, Rogers and Barnes are at a painting class when a man comes in and tells them that they are at war after Japan bombed Pearl Harbor. Barnes agrees to train Rogers to get him ready to enlist. After his training they both go to enlist where Barnes is enlisted but Rogers is told he his unfit for service. He tells Bucky that he is going to get a "second opinion".
Bucky later trained in Camp McCoy, Wisconsin, with the 107th Infantry Regiment. The 107th being the New York Army National Guard, based out of NYC. It was possible to be promoted to (Buck) Sergeant during training, only 3 promotions instead of 4 back in WW2.