Hi & Welcome!
Even with a machine with directional sewing, it is going to be difficult to get the lengthwise pant leg under the machine foot without opening the seam. At some point the material will bunch up and might catch the underside of pant leg.
It would be easier to open seam line and then restitch. You might not have to open seam into the hem area depending on the project.
Another option is to use a permanent fabric glue and glue on the stripes. I would use a bias tape maker so the edges are turned under if you are using fabric. Ribbon could be attached directly to the pant legs.
Good luck & again Welcome!