Maximize ratio of sums
There's a linear-time algorithm for this problem.  Find the index $j$ that maximizes the ratio $r_j = a_{1j} / a_{2j}$.  This $r_j$ is the maximum possible value of the ratio of sums.

Proof: The ratio of sums can be made $\ge c$ if and only if there exists a set $S$ such that $\sum_{j \in S} a_{1j} - c a_{2j} \ge 0$.  That's possible iff there exists $j$ such that $a_{1j} - c a_{2j} \ge 0$, i.e., such that $a_{1j}/a_{2j} \ge c$.

As a tip for how you could discover this on your own: play with some examples.  If you try many examples and work out by hand the optimal solution, you might happen to notice the pattern (that the best ratio for the sums matches the largest ratio of columns), and that would give you a hypothesis that you could then try to prove.