A proportion

is nothing but a comparison between two fractions: we can rewrite it as

So, we can multiply both sides by the two denominators b and d to get

In other words, a proportion is true if the product of the inner terms is the same as the product of the outer terms.
In your case, we have the check is the following:

which is clearly false. So, 24:40 = 4:7 is not a true proportion. In fact, if we convert fractions into numbers, we have

which makes even more clear that the proportion doesn't hold.