Aaron Gate of New Zealand clocked the fastest time in the time trial to win the men's omnium, while Jarmila Machacova of the Czech Republic won the women's points race ahead of Sofia Arreola Navarro of Mexico and Giorgia Bronzini of Italy.
James, a four-time junior world champion who won two bronze medals already this week, lost the first race in the best-of-three final but came back to win her first major title.
Wai Sze Lee of Hong Kong dominated Guo Shuang of China in two races for bronze.
Gate finished the final heat of the omnium but his opponent, defending champion Glenn O'Shea of Australia, had a mechanical problem and could not finish. The two were tied on 17 points after five of six events.
O'Shea clocked the fifth best time in the rerun and finished third overall with 22 points, one point behind second-place Lasse Norman Nahsen of Denmark.
Machacova won the 25-kilometer, 100-lap women's points race. Arreola Navarro was four points behind the Czech with one sprint left. She chased Anastasiya Chulokova of Russia to the finish but missed out by a wheel, earned only three points and had to settle for the silver medal. Bronzini was eight points behind Machacova.
"It was my dream to become a world champion," said Machacova, the runner-up two years ago. "And today my dream came true. It's amazing."