Also, addendum to the above good suggestions, use a SOLDERING IRON with a TIP wide enough to bridge BETWEEN the spots you’ve cleaned. So keep ‘em close to the ends. Put a pigtail–a twist in the wire, with ‘feeties’ stickin’ out so they reach PAST the solder puddles, described below.
Before doing that, clean those spots as advised, then TIN them: melt solder into a puddle at each place while fluxing. USE FLUX. ROSIN FLUX. Paste flux, don’t depend on the puny amount inside the ‘rosin-cored’ solder. MAKE SURE it is 40/60 Lead/Tin solder. Less trouble.
IF YOUR SOLDER BEADS UP AND ROLLS AWAY, YOU GOT PROBLEMS. There’s no way of telling what kind of brass (metallurgically-speaking) you’re getting in any given batch of rails. Clean it more, get a bigger iron, do something different, 'cause you ain’t gonna get nowhere lasting. Might look pretty. Post in a year or two, wondering about erractic performance.
Use a BIG iron, with a BIG, WIDE, FLAT TIP (like a chisel, called, strangely enough, ‘chisel tips’) SO THE RAILS DON’T ACT LIKE A GAINT HEAT SINK AND SUCK ALL THE HEAT OUT OF THE TIP in the range of 125W and upwards. Take the plastic ties off, first.
Or, get a small torch, ala Micro Mark/Harbor Freight (cheaper) and learn to solder brass with that, first. Flame chases solder away from where you want it. Learn to compensate by applying solder on the ‘upwind’ side of the torch flame, but ‘downwind’ from your joint, and try to keep same flame vertical to the joint. Or lift the flame just before you dab in the solder and ‘chase’ it with the flame. It’s all in the technique. (Evil Grin, not available in our Pink Icons).
Or, practice and figure it out for yourself. DO NOT pile three soldering GUNS on the same joint and hope for anything lasting, as has been bragged on this board. Anybody can get lucky now 'n then.
Oh, FWIW, I’ve