Not sure if I'm reinventing the wheel here, but....
Consider the 2 switches separately, because they are. The only thing they have in common is that they attach to the same gimbal ring.
The pair with both male bullet connector ends is the limit switch, which is only needed if you have a trailer switch (with the UP/DOWN switch. I don't have one on my boat.

). As Terry has said and you indicate in your photo, they connect to the trim pump harness blue (together with the white) and purple, orientation not critical.
The trim gauge wires should have a male and a female on them. One connects to ground, the other to the wire (usually a brown/white) that goes to the gauge...
Any of the old corroded wire you find, you can strip out and toss.
Chris......