You have 3-way switches. They have 3 separate binding screws and/or push in holes. One is a unique color or otherwise identified as common. The wires will either be travelers going to other switches, a wire supplying power from the distribution, box, or a wire to the light.
The common screw will always connect to either power or light wires. Travelers always connect to the other screws. It never matters which traveler connects to which un-common screw.
It's probably safe to assume the wires from downstairs is for the downstairs light switch and the ones from upstairs for the upstairs switch. You can almost hook things up in any configuration and nothing bad will happen. Things may not work, but there will not be any shorts, fires, smoke, etc.
There are a couple exceptions you must alway avoid. Never connect neutral (blue) to any switch. Pretty easy. Never connect wires from separate circuits to the same lighting switch. Obvious in theory, but it's not always easy to tell when staring into a box full of wires.
For each switch, you need to decide which is the power or light wire and connect it to the common screw. Connect the other two either way to the other screws. If you picked fully randomly, you have a 1:3 chance of being right. If it doesn't work, try one of the other two. You'll get it eventually. I would guess the red goes to the light and should be common, the two orange are travelers and go to the un-common screws. Note I said it's a guess. It's impossible to know for sure without testing.
The downstairs switch is bit different. There's only 2 wires and we need 3. We must have two travelers from the other switch, so these must be the wires from downstairs. That would leave the bedroom wire as a power supply. Is the downstairs brown wire marked in any way? That would be a good thing. If there's any chance the two brown wires carry power from different circuits, it could be a really bad situation. But there doesn't seem to be any other way to reasonably connect all 3 screws to wires.
What could also change the equation is if there was any short wire connecting the 2 switches. There wasn't was there? If not, my best guess is the brown bedroom wire to the common screw and the other 2 from downstairs to the remaining screws. Once again, this is a guess, but since the wire from the bedroom cannot be a traveler or light wire, it must be power.
Take this information as educational. I'm not telling you what to do, I'm telling you what I think the situation is. Use the information provided to decide for yourself what to do. This may include calling an electrician if you have any doubt. Electricity is nothing to chance any mistakes with.