A MIG 29 intercepting and joining up on a airliner at cruise altitude doing .80 Mach is a difficult maneuver to pull off. It would require excellent GCI and the ability to go supersonic. With the fuel limitations of the MiG 29 it would require near perfect timing on takeoff. It certainly can be done by competent air crew but timing would be critical.
In answer to can you see a fighter sized target at 40km the answer is basically no. If you know exactly where to look with a radar lock and hud queuing a fighter sized target is a pinhead at 20 km.