A sentence with "by which time" pretty much always is used along side a single point in time.
- One day, by his logic, the cryptocurrency market will have its “smartphone moment”, by which time retailers might begin to find
the prospect of dabbling in this space more attractive.
- His battle with cancer first became public in November, by which time the disease had spread from his oesophagus to the main
organs of kidney, lungs and liver.
- Rahul had visited the temples only in December, by which time the manuscript of Why I Am A Hindu was with the publisher, he
In these examples the phrase has been used with "One day", "November", "December", indicating a single point in time. The segment with "by which time" always comes with a comma(,) before and some scenario X after the phrase.
The use of the phrase "by which time" always means that
"from now by that particular time T has been reached" the
scenario X will happen/has happened(depending on the context).
My understanding is that, the example "between 2030 and 2040" also means same thing i.e.
"from now by that time 2030-2040 has been reached" the
"proportion of elderly people will be similar in the three countries".
If the example was meant to indicate the period of time from 2030 to 2040, then the sentence would have been written(or the correct way to write it would be) as
"A more dramatic rise is predicted between 2030 and 2040 in Japan,
during which time it is thought that the proportion of elderly people will be similar in the three countries."
Nevertheless the sentence "2030-40" could have been phrased better to avoid confusion.