On the problem of the existence for connecting trajectories under the action of gravitational and electromagnetic fields