EC 7639 then FR 6713 at Madrid
Lisbon → Madrid → Budapest
Timetable, Madrid time
08:20EC 7639 from Lisbon at the gate
06:00FR 6713 to Budapest leaves the gate
21 h 40 apart on the timetable, overnight
FR 6713 leaves 21 h 40 after EC 7639 arrives on the timetable: more than half a day, so not a connection we count.