In most cases, there is a window of time during intercourse, just as the male is approaching climax, when it may be too late for him to get out of dodge before ejaculation happens. Ballparking it from personal experience, I’d say it’s about… a couple of seconds, tops.
If he is directed by the female partner to cease his activities and withdraw before ejaculation during that window, then he may be out of luck. But it’s a very small window, and in any case no longer than it takes for him to understand the instructions and evacuate his penis from the lady.
However (and this is important): This is the case for an adult with some sexual experience. For a teenage boy having his first go at it, ejaculation may occur very suddenly and with little to no warning, and sometimes very early indeed into the sexual act. This is usually accompanied by a great deal of embarrassment on part of the boy.
The usual caveats apply: This is from my experience. It may be different for others.
As a rule: Better safe than sorry. If you don’t want someone ejaculating in you, then agree on that before the sex starts, and either have the guy wear some protection. or don’t have vaginal intercourse at all. There are lots of other fun things couples can do.
If the male has agreed before intercourse commences not to ejaculate, and still purposefully (or, really, accidentally) allows himself to reach the point where ejaculation may not be avoided, that he is at best an idiot and at worst malicious. And everyone involved needs to take a good look at themselves and reconsider their birth control strategies.
Is it rape? Doesn’t seem like the right question to ask. That’s not what makes something rape. Someone having sex with you without your consent is rape. If you say stop and he keeps going, for longer than it takes him to comprehend the instructions and remove himself, it’s rape. If he starts having sex with you in the first place without you agreeing to it, it is possibly rape and at least attempted rape. Ejaculation isn’t the important factor.