I won't swear to it; but I believe it can be done.
The length difference is only the part that protrudes into the pilot bearing, and the shorter ones seem to work fine (I've run both TR4 and TR6 boxes in my TR3s).
As Randy notes, the earlier front cover was longer, but it was shortened to clear the diaphragm clutch. Apparently the shorter one works OK even with the earlier finger clutch.
The mating gear is the same between TR3 & TR4 (Stanpart 105626) so the gear teeth must be the same.
The issue I think would be the bearing between the input shaft and the mainshaft; the TR4 shaft is bored larger (I think) for a roller bearing while the TR3 used a bushing. And I'm not certain offhand if the mainshafts are the same diameter or not; or if the TR3 mainshaft is hardened for the roller bearing. You might have to source (or make) a custom bushing to adapt the two together.
Might check with John Esposito at Quantum Mechanics. If it can be done, he's probably done it.
Randall - TR6 gearbox, TR3 top cover, TR4 overdrive all in a 56 TR3