A group of friends are at a baseball game and are purchasing souvenirs. Amelia purchased 1 t-shirt and 2 baseball caps, spending a total of $86. Her Cody purchased 4 t-shirts and 2 baseball caps, which cost him a total of $158. Assuming that all of the t-shirts and all of the caps are the same price, what is the price of each?

Let x be the price of each t-shirt.

So, each cap is also x.
Amelia spent 1 * x + 2 * x = $<<1*x+2*x=3*x>>3x.
Cody spent 4 * x + 2 * x = $<<4*x+2*x=6*x>>6x.
So, 3x = $86.
Therefore, the price of each t-shirt is x = $86/3 = $<<86/3=28.666666666666668>>28.67.
Hence, each baseball cap costs $28.67 too. Answer: \boxed{28.67}.