Clearly a reduction in exercise without a reduction in calorie intake has led to your weight gain.
Healthy eating does not necessarily mean less calories.
So my advice to you is get back to your longer rides. If you are riding for fitness and not for any particular type of racing or performance then go for what you enjoy. I suspect you enjoy the longer rides so go for that.
The body uses different energy systems which we all use differently depending on the volume, intensity of the cycling and the fitness of the rider.
For a rider cycling over 60 mins we rely almost exclusively on the aerobic oxidative energy system. The body will use fat or carbohydrate (glycogen). Stores of carbohydrate is limited and stored in the liver and muscle you only have a limited supply about 90 mins worth of exercise and this is about 2000 kilocalories so we also rely on fat as a fuel source
To highlight this a 70 kg person with 5% fat will have around 31,500 kilocalories to burn. The body will use both glycogen and fat together and the % of the mixture will change so accelerations will take more glycogen and easy riding more fat. The process to change fat to fuel takes longer and we have all experienced that feeling of our glycogen being used and we 'bonk' which is where you have moved to complete fat burn and hence you slow down to allow the fat to be converted.
So if you want to lose weight and your lifestyle allows then longer steady rides are the way to go for you. A word of warning though do not over eat once back home or when off the bike thats where most of us put on the excess weight.