The whole motherboard is going to be a limitation going from 20 to 40 MHz. It's not just the chipset, cache and RAM. The 74 series logic and the PAL/GAL/CPLD chips are also going to be limits. In the case of the PAL/GAL/CPLD, the parts could be rated fine to go faster, but if the equations and logic weren't designed to go that fast, it can throw the timing off and make them stop working properly. I would say that 25 MHz is probably doable, and 33 MHz would be a stretch. 40 MHz would need a whole lot of things to go right to work.
The ISA bus is another issue, you'll need to probe the clock pin on one of the slots to see what the bus speed is, and assuming you can get it booting at 40 MHz, you'd have to check the bus again to see if it's wildly out of spec. Most ISA cards from the late 80s to the mid 90s could tolerate ISA bus speeds in the ~10-13 MHz range, which is what many Pentium era boards would run the bus at. Earlier 8 bit ISA cards tended to be more speed sensitive because they were usually designed for the original XT bus.
If you wanted to upgrade, a better option would be to get a clock doubling CPU like the Cyrix Cx486DLC2. You'd need a driver in DOS to toggle the clock doubling most likely, but it would keep the bus at 20 MHz. If you wanted to try bumping the bus speed up to 25 MHz, you could get a 486DLC2 at 50 MHz for a modest performance boost. The 387 would run at half of the processor speed though.