Hello and welcome to the forums from Germany.
The term for that kind of pants is galon striped pants.
You can google that, there are still lots of pants that have them even today, they are still fashionable. But your hunch was intially correct, the origin of these galon stripes is indeed the military. Probably in the way we wear camouflaged shirts and pants now.