If it has a localised fungal infection which hasn't spread to the rest of the plant, it will die above the rotting section anyway, so I would cut it off about 6 inches below the wound, just above a leaf joint. What you don't want is for the fungus to set fruit (which will be hair-like and almost invisible) as they will release spores into the air which may infect other cucumber plants. If the rest of the plant is uninfected, it should produce side shoots from some of the junctions between the leaves lower down and the stem. Select the strongest of these as your new main stem and it may grow OK from there. Good luck!