It's not the total amount of work you do that matters, it's the volume, or the total amount of work per unit of time.
Compare the two people over a year - person A would have done approximately 7,000 pushups, while person B would have only done 1,300. Person A is doing over five times more exercise. Only if their volumes (number of sets or reps per week) were matched despite their different training frequencies (numbers of times exercising per week), such as if person A were doing a set of 25 pushups on four days of each week, and person B were doing four sets of 25 pushups on one day per week, would you expect them to have similar results.
Even with your comparison of person A after 50 days to person B after 280 days, when both have done 1,000 pushups in total, person A is still likely to have made greater progress. This is because muscle is in a state of near continuous breakdown, and it takes an ongoing training stimulus in order to prevent net muscle loss by ensuring that the amount of muscle being built is at least as the amount that is being lost. So while both people will have experienced the same training stimulus of 1,000 pushups, and hence the same stimulus for muscle growth, this needs to be offset by the fact that person B has experienced 280 days' of muscle breakdown, while person A has only experienced 50 days' worth. So person A will definitely have more muscle at that point (assuming they respond equally to training).
Consider muscle gain to be like a leaky bucket. You can still fill the bucket, but only if you're adding water (doing training) at a rate faster than that at which water is leaking from the bucket (muscle breakdown).
Finally, it should be noted that because neither person is incorporating any form of progressive loading (often called "progressive overload") into their training, neither is actually likely to make much progress. If every workout you do 25 pushups and never try to increase that number or add extra resistance, then you will very quickly get to the point where 25 pushups isn't enough to make you stronger, and you'll stop making any progress.