why didn't Lundy tell Debra about his upcoming retirement plans to keep their relationship going?
There's no indication that Lundy had already planned to retire!
In season 2, Lundy seems to be in the heat of his career, tracking serial killers across the country and being assigned to one of the biggest serial killer cases in FBI history. He seemed to really enjoy what he was doing, and, IIRC, he rarely [if ever] complained about the job.
That being said, IMO, Frank had no reservations of retiring during the events of season 2.
In season 4 though, as the OP mentioned, Lundy has retired, and is now tracking his own case (and is back in Miami). Per this timeline of events, there's about a four year difference between season 2 and 4, and a lot can happen in four years.
But, all in all, I don't think Frank ever had intentions of continuing things with Debra on a long term basis (I mean, his job heavily involves traveling, and this is a concern that Frank himself expressed). So, even if Frank was planning on retiring down the road, with him leaving Miami right after the BHB case, why would he tell Debra?
In all probability, Frank didn't plan on seeing Debra again after the BHB case. In fact, when he returned to Miami in season 4, he had already been there some time before coincidentally running into her.