Let the cost of a pen be \( p \) and the cost of a pencil be \( q \).
From the given conditions:
\[
2p + 3q = 86 \quad \text{(Equation 1)}
\]
\[
4p + q = 112 \quad \text{(Equation 2)}
\]
Multiplying Equation 2 by 3:
\[
12p + 3q = 336
\]
Now subtract Equation 1 from this:
\[
(12p + 3q) - (2p + 3q) = 336 - 86
\]
\[
10p = 250 \quad \Rightarrow \quad p = 25
\]
Thus, the cost of a pen is Rs. 25.