We consider free boundary minimal submanifolds in geodesic balls in the hyperbolic space Hn and in the round upper hemisphere Sn+. Similarly to the functional "the k-th normalized Steklov eigenvalue" introduced by Faser and Schoen, we define two natural functionals on the set of Riemannian metrics on a compact surface with boundary. We prove that the critical metrics for these functionals arise as metrics induced by free boundary minimal immersions in geodesic balls in Hn and in Sn+, respectively. We also prove a converse statement. Besides that, we discuss the (Morse) index of free boundary minimal submanifolds in geodesic balls in Hn or Sn+. We show that the index of the critical spherical catenoids in these spaces is 4 and the index of a geodesic k-ball is 2(n−k). For the proof of this statements we introduce the notion of spectral index similarly to the case of free boundary minimal submanifolds in a unit ball in the Euclidean space.