Since you process the main_menu.tmpl, it acts like it is defined in
the Template toolkit Manual.
Basically if you 'PROCESS' a template, it can modify the current variable stash, it does not use localization. So it sees and can modify all the variables you "have"(can use) in layout.tmpl in your first example (you pass the variables when you call $self->tt_process() for example in your perl code).
If you want to use it in a constant-like form though, why not just merge menu.def.tmpl and main_menu.tmpl together?