I purchased some slick fat tires online out of impulse, hoping that these 24x4 in tires would fit on my 26 by 4 inch rims. Or will they be too small?
They will be too small.
24 x 4 tires are meant for 24" wheels. Those are 2" less in diameter, for metric people about 5 cm less, than the size of your wheel. This is way to much to be able to fit them on the rim of your wheel.
In tubes there is some leeway but even there you would be on or beyond the limits.
As a rule of thumb, when measuring tyres the inch is pretty much useless.
This isn't a metric-fanboy statement - there are legitimately three different sizes that can be called 26 inch, and in other instances 27, 28, and 29 inch may be the same size or opposite order. It's seriously messed up.
SOLUTION The best thing you can do is use the ETRTO measurement on your tyre, also called the ISO size. For the most common 26" that will be 559mm, and the width of the tyre will also be there. A 2" wide 26" tyre would be a 54-559, or some manufacturers flip that for 559-54.
ANSWER Your 24" tyres probably says 507, or 531, or 534 (old), or 540, or maybe even 541mm somewhere on it.
A 26" tyre will likely be 559, with a small chance of 571 or 590.
None of these are equal, therefore you have zero chance of fitting any 24" tyre to a 26" nominal wheel.
WORKAROUND A 4 inch wide tyre (about 100mm) will be about the same "height". So if you had 24" wheels that matched your tyres, then the combination (507-100) would be about the same rolling circumference as a 26" wheel with a 2" tyre on it, or 559-54. Ballpark maths says thats 607mm vs 613mm rolling diameter, basically unnoticeable.
Downsides are that rim brakes won't work, so you'd require disk brakes. The frame would have to have clearance for such enormous tyres too, along with the chainline and derailleur clearing the tyre.
(However consider that you may be throwing good money after bad. The easiest thing to do is cancel the tyre order.)