Better way to count the number of occurrences of a maximum number in the array in Ruby
Your method shouldn't call the given array my_array. It's not the method's array, it's the caller's array. Just call it array, which is also shorter, so less clutter.
And you're making it very complicated. The array already offers all you need:
def max_number_count(array)
  array.count(array.max)
end

That's also much faster:
            user     system      total        real
yours   1.696091   0.034977   1.731068 (  3.476805)
mine    0.074057   0.000000   0.074057 (  0.131310)

Benchmark code:
require 'benchmark'

def max_number_count1(my_array)
    max_num, max_num_count = my_array.inject([0, 0]) { 
                               |arr, age| age &gt; arr[0] ? 
                               [arr[0] = age, arr[1] = 1] : age == arr[0] ?
                               arr[1] += 1 : arr[1] = arr[1]; 
                               arr 
                             }
    max_num_count
end

def max_number_count2(array)
  array.count(array.max)
end

n = 5
array = (1..1000).to_a * 1000
Benchmark.bmbm do |x|
  x.report(&quot;yours&quot;) { n.times { max_number_count1(array) } }
  x.report(&quot;mine&quot;)  { n.times { max_number_count2(array) } }
end