What you should have done was pinch off the top of the first stem when it was about 4 inches (10 cm) long. That would make the plant produce more than one stem. You can still do it now, but it won't be so effective.
Just pinch out the growing point with your finger and thumb. Don't try to "prune" the stem by cutting off half of its length.
"Climbing" sweet peas like yours grow to about 6 feet (2 meters). If you wanted them just to grow up to your wooden rail, you should have chosen bush or dwarf varieties, which don't really climb, produce multiple stems, and grow to about 12 to 18 inches tall and a similar width.
Sweet peas like full sunlight, so yours might be a bit too shaded by all the woodwork surrounding them. Next year, try putting the planter outside the railings, not inside. Sweet peas are perfectly hardy, so you don't need to worry about the weather damaging them.
(It's not very clear from your picture how high above ground level the railings are, so apologies if putting the planter outside is impossible.)