All rear derailleurs have a maximum cog and maximum chain capacity...
A modern long cage mtb derailleur can handle 34 teeth (cogs) and probably has a maximum capacity of 36 - 38 teeth.
Calculating the maximum capacity is done by subtracting the number of teeth on the smallest chain ring from the biggest and adding this to the difference between the largest and smallest cog.
If your chain ring and cassette numbers do not exceed the maximum capacity you should be fine and swapping the road rear d for an mtb long cage and a wider range cassette should not cost much and let you retain the double crank and your existing shifters.