If, while jumping a vertical in a jumper class, you dislodge a lower rail without dislodging the top rail (it can be done, as I know from personal experience), you will not be penalized for the rail according to EC rules.
For hunters, here are the official rules regarding knock-downs:
ARTICLE G407 THE SCORING OF HUNTERS
2. An obstacle is considered knocked down when its height is lowered by the horse or rider.
3. If the height of the jump is altered as a result of a horse or rider contacting a wing or post it will be scored as a knockdown.
4. If a jump falls as a result of a horse or rider contacting a wing or post it will be scored as a knock-down.
And the rules for jumpers:
FEI ARTICLE 217 KNOCK DOWN
1. An obstacle is considered to have been knocked down when, through a mistake of the horse or competitor:
1.1. the whole or any upper part of the same vertical plane of it falls, even if the part which falls is arrested in its fall by any other part of the obstacle (218.1);
1.2. at least one of its ends no longer rests on any part of its support.
2. Touches and displacements of any part of an obstacle or its flags, in whatever direction, while in the act of jumping, do not count as a knock down. If in doubt the Ground Jury should decide in favour of the competitor. The knock down or displacement of an obstacle and/or a flag as a result of a disobedience is penalized as a refusal only. In the event of the displacement of any part of an obstacle, (except the flags), as a result of a disobedience, the bell will be rung and the clock stopped while the displacement is re-adjusted. This does not count as a knock down and is only penalized as a disobedience and corrected by time in accordance with article 232.
3. Penalties for knocking down an obstacle are those provided for under Tables A and C (236 and 239).
4. If any part of an obstacle, which has been knocked down is likely to impede a competitor in jumping another obstacle, the bell must be rung and the clock stopped while this part is picked up and the way is cleared.
5. If a competitor jumps an obstacle correctly which has been improperly rebuilt, he incurs no penalty; but if he knocks down this obstacle he will be penalized in accordance with the table in use for the competition.
FEI ARTICLE 218 VERTICAL AND SPREAD OBSTACLES
1. When a vertical obstacle or part of an obstacle comprises two or several parts placed one above the other and positioned in the same vertical plane, only the fall of the top part is penalized.
2. When a spread obstacle which requires only one effort comprises parts which are not positioned in the same vertical plane, the fall of one or several top parts only counts as one fault whatever the number and position of the parts which have fallen. Trees, hedges etc. used as filling are not liable for penalties.