The helper trait works, but then you're running into an annoying (but common) closure inference problem.
I worked around it with a helper function; someday there will be a more ergonomic solution.
As an explanation for why you need the helper trait, or the ability to name Fn<(...)> without mentioning <_ as Fn<...>>::Output... Here:
fn create_and_use<F, T: Test>(ctx: i32, factory: F)
where
F: for<'any> Fn(&'any i32) -> T
Type parameters like T must resolve to a single concrete type. But types that differ by lifetime only are still distinct types. You need some sort of type constructor by way of an associated type. (By way of an associated type because Rust doesn't have generic type constructors.)