Fraile edged Sonny Colbrelli (Bahrain-Merida) after making his move 300 meters from the end of a 166km stage from Fribourg to Delemont, with Rui Costa (UAE Team Emirates) third.
"In general, our team was super today, we did a strong race," Fraile said. "After all these climbs we still had many riders in the leading group and my teammates did a big job for me.
"In the final part of the stage, I’ve realized our group can come to the finish for a sprint, so Dario Cataldo and Jakob Fuglsang worked hard to chase all attacks and to bring me in front.
"I knew Sonny Colbrelli was my biggest rival today since he is a very fast guy. So, I followed his wheel and started my sprint with around 300 meters to go. It was a good decision since at the last 100 meters there was a small uphill."
Roglic finished with Rohan Dennis (BMC) to lead overall on the same time as the Australian. Geraint Thomas (Sky) is third, four seconds back.
The 28-year-old Roglic is seeking a second stage-race title this month after winning the Itzulia Basque Country.
Thursday's second stage is a 173.9-km ride from Delemont to Yverdon-les-Bains.
Australian Michael Matthews (Sunweb), who won the prologue, was dropped on the final climb to lose the yellow jersey to Roglic. Defending champion Richie Porte sits 13 seconds adrift in 10th.