There is no such law "requiring" engine replacement at a certain mileage. That is a urban myth propagated by importers and car owners who simply don't know or understand the situation in Japan. The high taxes (annually assessed), insurance premiums, gas costs, and especially the safety inspection/registration (occurs biennial) combine to keep turnover of vehicles high.
For example, the Safety inspection for your typical car (say Camry/Accord type) can typically cost $2,000....each time! New vehicles have a 3 year grace period before they are required to submit for the Safety Inspection. In other words, for a 10 year old car, you will have already paid over $8,000, in just Safety Inspection fees! Don't forget, gas over in Japan is also typically four times the cost of here in the U.S. Mileage is kept low on the vehicles as EVERYONE (unless your fabulously rich and patient) uses alternative transportation to get around. Most folks use the trains for local and medium distance traveling/commuting.
Far distances are taken by airplane and local transportation done by either bicycle or bus. In that society, your car tends to be a status symbol more than anything else. I hope this sheds a little more light for you!
Used to be, anyway, that you could buy a very low mileage engine of a Japanese car because their idiot laws force them to change the engine at something like 30,000 miles.
If you look around, I would think you should still be able to get low mileage Japanese engines/transmissions/etc for reasonable amounts of money.
For example, when my wife's Civic has got a damaged engine (2 years ago?), due to a cooling issue, I think it was only around $1000 for both the engine and transmission combined (and they both had under 50,000 miles on them, if memory serves correctly). Of course, I then had to pay a mechanic for a number of hours of their time to do the actual work, as well as for any parts (other then the engine and transmission themselves) we also replaced at the same time (while we had everything opened up), but we still got the entire job done (all parts and labor) for under $2000 total. And for that, the car now is running again with an "almost new" engine and transmission (as well as a number of lessor parts we also swapped at the same time).
The reason this works seems to be related to Japanese laws (as you mentioned). However, it was my understanding (but this is only second hand info, so I'm not sure how accurate it is) that it wasn't a "forced to change" law per se, but rather very strict laws about what shape a car can be in and still driven on Japanese roads. As a result, many cars (actually used in Japan) are "junked" (often for "trivial issues" such as rust on the body) at much lower mileage than you would see in many other countries, because the car no longer can meet the strict inspection that is required to actually drive that car in Japan.
And do to the low mileage when the cars (actually driven in Japan) are junked, many of the "junk yard parts" (actually in Japan) are still in very good shape. Of course, to actually get those good deals, you have to find some importer that has made a deal to buy these junk parts and ship them into the USA. But thankfully there are such places that have made these deals, resulting in some pretty good deals on (low mileage) used parts (including such main parts as engines and transmissions) for Japanese cars.
And since many of the Japanese cars were built to use "interchangeable parts" (i.e. many use the same parts for many different models/years of cars from the same company), you can often still get decent (low mileage) parts that will fit a Japanese car that was made years ago (even if/when the part you purchased actually came off of a much more recent junked Japanese car).
Of course, like any "used parts", there is still some risk to this approach. However, there are risks with a "rebuild" of an existing part as well. And with the costs of these imported (junked, low mileage) parts often being cheaper than dong a rebuild, this can sometimes be an option worthwhile to consider (assuming you can find a mechanic willing to let you hire them to do a major part swap, such as putting a different engine in).